PHP Shell Script Question
Moderator: General Moderators
- MathewByrne
- Forum Commoner
- Posts: 38
- Joined: Sat Mar 27, 2004 9:49 pm
- Location: Australia
PHP Shell Script Question
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?
You could probably test to see what differences there are between this output in a browser or cli.
Code: Select all
echo '<pre>'; // for browsers..
foreach ($_SERVER as $key => $value)
{
echo "$key=$value\n";
}
echo '</pre>';