I am programming a function that queries a database for filenames and returns those filenames as an array to be used in a zipfile. I am stuck on an error I am getting:
Parse error: syntax error, unexpected T_FUNCTION, expecting T_VARIABLE in /home/kwst/wwwroot/kwst-ads.com/admin/writezip.php on line 23
Here is the code from writezip.php
14 var $oldOffset = 0;
15
16 /**
17 Function to create the directory where the file(s) will be unzipped
18
19 @ $directoryName string
20
21 */
22
23 var function addDirectory($directoryName) {
24 $directoryName = str_replace("\", "/", $directoryName);
25
26 $feedArrayRow = "\x50\x4b\x03\x04";
27 $feedArrayRow .= "\x0a\x00";
The only things I have changed in the script is I used “var” insead of “public” because I don’t have PHP5 installed on my machine. I don’t see the error though. How can I correct this?