Hello All,
This is my first post in the forum.... I have a very simple code, and have searched and searched and keep seem to get it to work. Currently it read my fsocket and then returns my string ASCII, it just get hung up in infinate loop
while (! feof ($fp))
{
$c= fgetc($fp);
echo $c;
if($c === false) break;
// ... do something with $c
fclose($fp);
}
Now I have two issues the first is that I have to use fgetsC because I cant get my string to return unless I read each character one by one. I am reading directly from the device NOT a file. Am I possibly using the wrong method? If someone has a suggestion on this Im open for trying it 🙂 I have tried the streaming socket thing with no luck.
The device I am connecting to is suppose to send a carriage return when complete. Unfortunely the string has spaces in it so i cant use that as a break.
If more code is needed let me know. Thanks for any help!