i have the code for to create the zip folder.But in that i got the errors.plz tell that whats the mistake in my code.
createZip.inc.p hp
[php]
<?php
class createZip {
public $compressedData = array();
public $centralDirecto ry = array(); // central directory
public $endOfCentralDi rectory = "\x50\x4b\x05\x 06\x00\x00\x00\ x00"; //end of Central directory record
public $oldOffset = 0;
public function addDirectory($d irectoryName) {
$directoryName = str_replace("\\ ", "/", $directoryName) ;
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in F:\Facebook\fur niture11\create Zip.inc.php on line 3
I've merged your new thread into this one, seeing as they are dealing with the same exact topic.
Try not to spread the same problem over multiple threads. It can get very messy very quickly.
As to the code.
Which version of PHP are you running?
The code you posted is clearly written for PHP5. The class visibility keywords are not supported by the old, deprecated, PHP4, nor any of it's predecessors, and would most likely cause parse errors, like the one you posted.
If you are still using PHP4, I strongly recommend upgrading to PHP5 as soon as possible.
i have the code for to create the zip folder.But in that i got the errors.plz tell that whats the mistake in my code.
createZip.inc.p hp
[php]
<?php
class createZip {
public $compressedData = array();
public $centralDirecto ry = array(); // central directory
public $endOfCentralDi rectory = "\x50\x4b\x05\x 06\x00\x00\x00\ x00"; //end of Central directory record
public $oldOffset = 0;
public function addDirectory($d irectoryName) {
$directoryName = str_replace("\\ ", "/", $directoryName) ;
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in F:\Facebook\fur niture11\create Zip.inc.php on line 3
By using the php5 i solved the problem.In that only we created the zip file and created the new dir folder in that then after add the files into that folder.But my requirement is to convert the zip file from already existed folder.How i modify the above code.plz give the solution for that.
Comment