while(true) { //echo "\x1b\x5b\x58\x1b\x5b\x32\x4a"; usleep(900); if (!isset($tmp['stream'])) { echo 'command # '; } $tmp['stream'] = $player->stdin(); if ($tmp['stream'] != NULL) { if (!($tmp['buffer'] = $player->command($tmp['stream']))) { echo 'Responce from player object, request to shut down.' . "\n"; break 2; } echo $tmp['buffer'] . "\n" . 'command # '; } }