Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

Friday, August 14, 2009

More PHP oddities

Apparently, true prints as 1, while false prints as the empty string.

Also, empty() considers the string and the number 0 to be empty.

Sunday, July 12, 2009

PHP and fgets()

In an attempt to mimic behaviour of fgets in C, it appears that PHP defines the $length argument as the number of characters - 1 that should be read.
The length argument to fgets in C includes the '\0', but PHP really has no reason to care about that issue.