1

I am using PHREST method for getting photo from MLS Server. I am not able to get images of property for that I am using below function.

if ($rets->NumRows() > 0) 
{
    while ($record = $rets->FetchRow($search)) 
    {
        $photos = $rets->GetObject("Property","Photo",$record['ListingID'],"*",0);
        echo "<pre>";
        print_r($photos);

        foreach ($photos as $photo) {
                $listing = $photo['Content-ID'];
                $number = $photo['Object-ID'];

            if ($photo['Success'] == true) {
                $contentType = $photo['Content-Type'];
                $base64 = base64_encode($photo['Data']); 
                echo "<img src='data:{$contentType};base64,{$base64}' />";
            }
            else {
                echo "({$listing}-{$number}): {$photo['ReplyCode']} = {$photo['ReplyText']}\n";
            }
        }
        echo "<pre>";
        print_r($record);
    }

    $maxrows = $rets->IsMaxrowsReached();
    echo "    + Total found: {$rets->TotalRecordsFound()}<br>\n";
}
  • Please help any one i am getting the output array is like this only...Array ( [0] => Array ( [Success] => [Content-Type] => text/xml [MIME-Version] => 1.0 [Length] => 138 [Data] => [ReplyCode] => 20402 [ReplyText] => Unknown Resource A2168075 Reference ID: cda8fdd8-ad8d-43f1-8472-883e4f84c7c0 ) ) (-): 20402 = Unknown Resource A2168075 Reference ID: cda8fdd8-ad8d-43f1-8472-883e4f84c7c0 – Sujith Aravind Feb 24 '16 at 05:47

0 Answers0