php的shell_exec使用,php shell_exec() 命令用法_PHP教程

$bf = new chargen(2); // new chargen object, length 2

$bf->generate("whois"); // generate chars and call whois function

function whois($str)

{

$domain = $str.".com";

$retval = shell_exec("whois $domain");

if (eregi("no match", $retval))

echo $domain." ist availablen";

else

echo $domain." is unavailablen";

}

class chargen

{

private $chars = NULL;

private $maxlength = NULL;

protected $buffer = NULL;

function generate($mycallback = false)

{

foreach ($this->buffer as $char)

{

foreach ($this->chars as $nextchar)

{

$retval = $char.$nextchar;

$this->buffer[$retval] = $retval;

if ($mycallback && function_e

你可能感兴趣的:(php的shell_exec使用,php shell_exec() 命令用法_PHP教程)