How To Read the Entire File into a Single String?How To Turn On the Session Support? ~ Interview Questions & Answers

Sunday, August 12, 2007

How To Read the Entire File into a Single String?

If you have a file, and you want to read the entire file into a single string, you can use the file_get_contents() function. It opens the specified file, reads all characters in the file, and returns them in a single string.

Friday, August 3, 2007

How To Turn On the Session Support?

The session support can be turned on automatically at the site level, or manually in each PHP page script:
* Turning on session support automatically at the site level: Set session.auto_start = 1 in php.ini.
* Turning on session support manually in each page script: Call session_start() function.