0) { if (($in_string != "quit") && ($in_string != "")) { // parse function from command $cmd = substr($in_string,0,strpos($in_string," ")); // parse parameters from remainder of command $preparm = substr($in_string,strpos($in_string," ")+1); $parm = explode(" ",$preparm); // check for existance of function. If exists call it if ($cmd == "include") { eval("include(\"" . $preparm . "\");"); } elseif (function_exists($cmd)) { // print output of function arguments $result = call_user_func_array($cmd, $parm); if (strpos($result,"\n") != 0) { fputs(STDOUT, $result); } else { fputs(STDOUT, $result . "\n"); } } else { fputs(STDOUT, "ERROR: Function does not exist\n"); } }elseif ($in_string == "quit") { break; }else { fputs(STDOUT, "ERROR: Problems with input\n"); } }else { fputs(STDOUT, "ERROR: Input expected\n"); } } ?>