ridiculous Posted September 8, 2008 Share Posted September 8, 2008 RESULTS OF VAR DUMP string(18) "+OK 1218 octets " //var_dump($a) string(16) "+OK 1218 octets " //var_dump($b) I am pulling var $a off of a socket connection with the following code: $a=fgets($fp, 1024); And manually typing in var $b as a string. When I do a comparison test...they obviously aren't equal. Does anyone know what var $a could have that makes the string 2 characters longer? Quote Link to comment Share on other sites More sharing options...
ratcateme Posted September 8, 2008 Share Posted September 8, 2008 it could have a \r\n on it try var_dump(trim($a)); Scott. Quote Link to comment Share on other sites More sharing options...
ShaunO Posted September 8, 2008 Share Posted September 8, 2008 If it's from sockets it most likely does have \r\n on the end. Quote Link to comment Share on other sites More sharing options...
ridiculous Posted September 8, 2008 Author Share Posted September 8, 2008 Right on! You guys were money. Thanks a lot. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.