For my project I have to communicate from my (php) website to remote devices. One of the commands that I need to implement sends a continuous stream of data until it receives more input from the user.
So my question is will this be a problem if I use file_get_contents()? Or should I use fread()? My input is in the form of a string which fread() says I should use file_get_contents(), however if I use file_get_contents() will I need to put it in a loop then between packets send data to my device to stop it sending data? Will a loop close my connection and open a new one each time I call file_get_contents()?
I am also limited on the amount of data I can use per day to the point where if I use file_get_contents() and it limits on chunk the chunk size of 8KB that is 8% of my data for the day.
Use
fsockopen,fread, etc… The purpose offile_get_contentsis file reading, not to send/receive data the way you want.