PEAR Manual
This manual is provided as a courtesy. It is not an official source. Please check pear.php.net for updated information.
require_once 'Archive/Tar.php';
boolean extractInString (string $path)
boolean extractInString
This method extracts the file identified by path from the archive and returns it as a string. It does not use temporary files.
string $path - the path of the file to extract
string - the content of the extracted file
Table 38-1. Possible PEAR_Error values
This function can not be called statically.
Example 38-1. Extract a file in a string
// tarname.tar with files : // dev/data/file.txt // dev/data/log.txt // dev/readme.txt $tar_object = new Archive_Tar("tarname.tar"); $text = $tar_object->extractInString("dev/readme.txt"); echo $text;