recent searches:
include functions ,
variable functions ,
post functions...
If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.
PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.
fread() reads up to
length bytes from the file pointer
referenced by handle. Reading stops when up to
length bytes have been read, EOF
(end of file) is reached, (for network streams) when a packet becomes
available, or (after opening userspace stream) when 8192 bytes have been read
whichever comes first.
Returns the read string or FALSE in case of error.
<?php |
| Warning |
On systems which differentiate between binary and text files (i.e. Windows) the file must be opened with 'b' included in fopen() mode parameter. |
<?php |
| Warning |
When reading from anything that is not a regular local file, such as streams returned when reading remote files or from popen() and fsockopen(), reading will stop after a packet is available. This means that you should collect the data together in chunks as shown in the examples below. |
<?php |
<?php |
Note: If you just want to get the contents of a file into a string, use file_get_contents() as it has much better performance than the code above.
See also fwrite(), fopen(), fsockopen(), popen(), fgets(), fgetss(), fscanf(), file(), and fpassthru().
Another Useful functions:
function.fread |
PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.