require_once 'Archive/Tar.php';
boolean addString (string $filename, string $content)
boolean addString
This method adds the string content in the archive like a file with full filename filename.
If the archive does not exists it attempts to create it.
string $filename - the path and filename that will be associated with the added string in the archive.
string $content - the string to add in the archive as a file.
boolean - Returns TRUE on success, FALSE on failure.
Table 38-1. Possible PEAR_Error values
This function can not be called statically.
Example 38-1. Add a string in a compressed archive
$tar_object = new Archive_Tar("tarname.tgz"); $content = "this file was generated from a string"; $tar_object->addString("data/readme.txt", $content); // A file is created in the archive with name : // data/readme.txt