没有在PHRETS中获取照片

时间:2016-02-23 13:31:38

标签: php phrets

我正在使用PHREST方法从MLS Server获取照片。我无法获得我正在使用以下功能的属性图像。

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";
}

0 个答案:

没有答案