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? Link to comment https://forums.phpfreaks.com/topic/123213-solved-strings-look-identical-but-var_dump-different-number-of-values/ 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. Link to comment https://forums.phpfreaks.com/topic/123213-solved-strings-look-identical-but-var_dump-different-number-of-values/#findComment-636336 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. Link to comment https://forums.phpfreaks.com/topic/123213-solved-strings-look-identical-but-var_dump-different-number-of-values/#findComment-636337 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. Link to comment https://forums.phpfreaks.com/topic/123213-solved-strings-look-identical-but-var_dump-different-number-of-values/#findComment-636341 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.