oic
May I suggest a slight change then?
getinfo() accepts the descriptor, the number of characters following the descriptor that should be read, as well as the string that is to be parsed.
It returns the characters following the descriptor, if any.
function getinfo($descriptor, $readlen, $data)
{
//find the descriptor
$descpos = strpos($data, $descriptor);
//change the position to the end of the descriptor
//I think that this takes into account the = sign (not sure though)
$descpos += strlen($descriptor);
//now we get the info we want
return substr($data, $descpos, $readlen);
}
Now, once you have the info, you can use it
i.e.
$User_Name = getinfo("User_Name", 10, $string);