Sincerely Negin Nickparsa On Wed, Aug 20, 2014 at 8:09 AM, Jim Giner <jim.giner@xxxxxxxxxxxxxxxxxx> wrote: > On 8/20/2014 11:00 AM, Negin Nickparsa wrote: > >> echo "you entered ".$input; >> if($stock[$input]!=NULL) >> { >> $answer=$stock[$input]; >> socket_write($sock,$answer, $port); >> >> } >> else{ >> echo socket_strerror(0); >> } >> > > How about adding the following before the above lines: > if (!isset($stock[$input])) > print_r($stock); > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Jim you were right it wasn't set the output is as follow: c:\wamp\www\phpzend>php -f server.php you entered salam Array ( [salam] => salam [esmet chie] => negin [chika mikoni] => socket minevisam! ) Notice: Undefined index: salam in C:\wamp\www\phpzend\server.php on line 14 Call Stack: 0.0010 232832 1. {main}() C:\wamp\www\phpzend\server.php:0 The operation completed successfully. Also Robert I did trim it as you said and the result didn't change so what's the problem why it is not set! there?!