Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites
integer filesize(string filename) The filesize function returns the size of the given file in bytes. <? print(filesize("data. ...
<? $fp = fopen("log.txt", "a"); //get lock flock($fp, 2); //add a line to the log fputs($fp, date("h:i A l F dS, Y\n")); //re ...
While it is an error to open a file for writing when an HTTP URL is specified, this is not the case with FTP. You may upload an ...
print("Local\n"); print("\n"); // open a local file if(!($myFile = fopen("data.txt", "r"))) { print("file could not be opened"); ...
$KeepSearching = FALSE; } //try adding some text after the title tag $myLine = eregi_replace("", "(fpassthru example)", $myLine) ...
<? /* * Check that a file is a GIF89 / $filename = "php.gif"; $fp = fopen($filename, "r"); //get first 128 bytes $data = frea ...
print("file could not be opened"); } ?> array fstat(integer file_handle) The fstat function gets information from C's stat fu ...
<? // open file for writing $myFile = fopen("data.txt","w"); // make sure the open was successful if(!($myFile)) { print("fil ...
include(string filename) The include function causes the PHP parser to open the given file and execute it. The file is treated a ...
You may also specify files by URL by starting them with http:// or ftp://. PHP will fetch the file via the stated protocol and e ...
The is_file function returns true if the given filename is neither a directory nor a symbolic link; otherwise it returns false. ...
print("$filename is readable"); } else { print("$filename is not readable"); } ?> boolean is_writeable(string filename) The i ...
<? print(linkinfo("data.txt")); ?> array lstat(string filename) The lstat function executes C's stat function and returns ...
...
boolean mkdir(string directory, integer mode) The mkdir function creates a new directory with the supplied name. Permissions wil ...
print("\n"); ?> integer pclose(integer file_handle) The pclose function closes a file stream opened by popen. The return valu ...
string readdir(integer directory_handle)y The readdir function returns the name of the next file from a directory handle created ...
boolean rewind(integer file_handle) The rewind function moves PHP's internal file pointer back to the beginning of the file. Thi ...
print("\n"); // Go back to beginning rewinddir($myDirectory); print("\n"); print("Size\n"); // get each entry while($entryName = ...
<? // open file for writing $myFile = fopen("data.txt","w"); // make sure the open was successful if(!($myFile)) { print("fil ...
«
3
4
5
6
7
8
9
10
11
12
»
Free download pdf