Hello,
I'm having some trouble splitting the output of a function in a class such that it returns two return commands one after the other.
$data contains one or two "</machineguid></data>"s. If there is two, I want to send the second one in a different return command, so that it appears to be a separate $data value. Some code might help:
function _get($use_fread=0)
{
$data = ($use_fread) ? @fread($this->sb, $use_fread) : @fgets($this->sb, 4096);
//$data = fgets($this->sb, 4096);
if ($data)
{
If(strpos($data, '</machineguid></data>') > 0){
$bilgi = explode('</machineguid></data>', $data);
if ($this->debug) echo "<div class=\"r\"><<< SB: $bilgi[0]</div>\n";
return $bilgi[0];
If(strlen($bilgi[1]) > 0){
if ($this->debug) echo "<div class=\"r\"><<< SB: $bilgi[1]</div>\n";
return $bilgi[1];
}
}
if ($this->debug) echo "<div class=\"r\"><<< SB: $data</div>\n";
return $data;
}
else
{
return false;
}
}
Even though some part of the code must be working as the data is returned (not split even if two mach id phrases are in it) the script does not print the data. $debug is set to 1.
My knowledge of classes is minimal, any help will be much appreciated, thanks. :o