The 5th Annual China PHP Conference

Voting

Please answer this simple SPAM challenge: max(six, one)?
(Example: nine)

The Note You're Voting On

drewish at katherinehouse dot com
11 years ago
When you're writing one line php scripts remember that 'php://stdin' is your friend. Here's a simple program I use to format PHP code for inclusion on my blog:

UNIX:
  cat test.php | php -r "print htmlentities(file_get_contents('php://stdin'));"

DOS/Windows:
  type test.php | php -r "print htmlentities(file_get_contents('php://stdin'));"

<< Back to user notes page

To Top