note 57143 added to features.commandline
| From: | drewish at katherinehouse dot com | Date: | Sun, 25 Sep 2005 07:08:54 +0000 |
| Subject: | note 57143 added to features.commandline | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-95737@lists.php.net to get a copy of this message | ||
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'));"
----
Manual Page -- http://www.php.net/manual/en/features.commandline.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57143
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57143&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57143&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57143&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57143&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57143&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57143&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57143&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57143&report=yes
Search -- http://master.php.net/manage/user-notes.php