Re: Re: socket gives notice on server side(simple newbie code)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?!

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux