doumiebiao6827 2016-11-12 04:22
浏览 71
已采纳

PHRETS GetObject()返回数组,需要提取URL

I'm performing a for loop to iterate through MLS listings. I'm able to get every bit of information I need but I can't seem to figure out how to extract the URL from the array I get.

Here's the array I get from my for loop:

PHRETS\Models\Object Object

(

[content_type:protected] => text/xml
[content_id:protected] => 9577056
[object_id:protected] => 1
[mime_version:protected] => 
[location:protected] => http://cdnparap100.paragonrels.com/ParagonImages/Property/P10/CAT/9577056/0/0/0/42ab28468ab0dfc6fd83dfb39e5dfff7/3/55ec2da6d4a32437d345d0992fae1851/9577056.JPG
[content_description:protected] => 
[content_sub_description:protected] => 
[content:protected] => 


[preferred:protected] => 
[error:protected] => PHRETS\Models\RETSError Object
    (
        [code:protected] => 0
        [message:protected] => 
    )

)

The following is the code I'm using to get that output. I'm just wondering if there's a way to do a trim or something to extract the URL so I can store it.

for ($i = 0; $i <= count($listID); $i++) {

$photo = $rets->GetObject('Property', 'Photo', $mls, '*', 1);

foreach ($photo as $image) {
    echo "<pre>";
    print_r($image);
    echo "<br>";
    echo "</pre>";
}
}
  • 写回答

1条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥15 速帮,学校需要在外上班没空
  • ¥15 人在外地出差,速帮一点点
  • ¥15 如何使用canvas在图片上进行如下的标注,以下代码不起作用,如何修改
  • ¥15 Windows 系统cmd后提示“加载用户设置时遇到错误”
  • ¥50 vue router 动态路由问题
  • ¥15 关于#.net#的问题:End Function
  • ¥15 无法import pycausal
  • ¥15 VS2022创建MVC framework提示:预安装的程序包具有对缺少的注册表值的引用
  • ¥15 weditor无法连接模拟器Local server not started, start with?
  • ¥20 6-3 String类定义