Back tick operator for executing shell commands

Say you want to know what user is executing your scripts or what account you are running under. Here's a quick way to do it.

<?php
$username = `whoami`;

echo $username;

Just surround your shell commands with a back tick ` and it will store the output in a variable.

The back tick is on the key with the tilde ~ and to the left of the one (1) key.

Page Comments (Click to edit)

Design by N.Design Studio, adapted by solidGone.org (version 1.0.0)
Powered by pmwiki-2.2.0-beta65