Welcome To Snipplr
Everyone's Recent PHP Snippets Tagged line
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
« Prev 1 Next »
read the first line of text of a file on the server
To read the first line of text in your file:
The fgets () function retrieves the first 4096 characters from the first line of your file.
0
1308
posted 5 years ago by martinbrait
If you want to use PHP as a command line program, this code can serve s a reference to read the arguments passed to the program.
0
760
posted 13 years ago by tcam27
This method is easy to write, but not very efficient, as you can imagine.
2
1343
posted 13 years ago by dyteq
i know these regex stuff is rather slow, but still i like having slim documents. (don't forget to use gzip compression on all text docs)
3
838
posted 15 years ago by iroybot
This will print every number from 0000-9999. Each number is comma separated.
The goal was not pretty / readable code, but to get all code on a single line.
0
598
posted 16 years ago by tgpo
« Prev 1 Next »