PHP Shell Script Question
Posted: Thu Sep 28, 2006 2:38 am
Is there a simple way of determining if a person is running PHP from a CLI interpreter or viewing a php file through a browser?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
echo '<pre>'; // for browsers..
foreach ($_SERVER as $key => $value)
{
echo "$key=$value\n";
}
echo '</pre>';