PHP to read a string from socket
<p>I bind with a socket as follows:</p>

<pre><code>&lt;?
// set some variables
$host = "x.x.x.x";
$port = 1234;
// don't timeout!
set_time_limit(0);
// create socket
$socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create
socket\n");
// bind socket to port
$result = socket_bind($socket, $host, $port) or die("Could not bind to
socket\n");
?&gt;
</code></pre>

<p>Now how do I read strings coming from the socket and store it in a variable? 
The socket has collection of strings in the following format:
12;3p6;4p</p>

<p>where p is the terminating character for each set of a;b values
Thank you</p>
