object(stdClass)#8 (2) { ["schema"]=> string(894) "" ["any&q"/> object(stdClass)#8 (2) { ["schema"]=> string(894) "" ["any&q">
Home > Backend Development > PHP Tutorial > 调用接口有关问题

调用接口有关问题

WBOY
Release: 2016-06-13 13:41:08
Original
1320 people have browsed it

调用接口问题
返回的数据用var_dump输出是:

object(stdClass)#7 (2) { ["GetCustomerListResult"]=> object(stdClass)#8 (2) { ["schema"]=> string(894) "" ["any"]=> string(21628) "
0.1000hzbfcsqyglv@xxx.cn2011-10-19T15:14:47+08:0043889信息技术有限公司
信息技术有限公司
0.3000hzbfxxjsglv@xxx.cn2011-10-19T15:20:45+08:0043891教育
商务大厦东三楼
0.3000jsjyglv@xxx.cn2011-10-19T15:27:01+08:0043893留学
国际大厦1号楼
0.3000ucasliuxueglv@xxx.cn2011-10-19T15:30:17+08:0043894国联
北园18-19幢
0.3000zgglglv@xxx.cn2011-10-19T15:32:21+08:0043896教育
浙江
0.3000xdjyglv@xxx.cn2011-10-19T15:34:29+08:0097479上海
上海
0.3000shjrglv@xxxx.cn2011-12-09T12:01:56+08:0097688南京
南京
0.3000njjrglv@xxx.cn2011-12-09T13:40:49+08:0097690广州
广州
0.3000gzjrglv@xx.cn2011-12-09T13:51:40+08:0097691深圳
深圳
0.3000szjrglv@xx.cn2011-12-09T13:53:56+08:0097692苏州
苏州
0.3000suzjrglv@xx.cn2011-12-09T13:56:23+08:0097693常州
常州
0.3000czjrglv@xx.cn2011-12-09T13:58:26+08:0097699无锡
无锡

现在要把它处理好保存到数据库……
怎么办?

------解决方案--------------------
$str=$obj->GetCustomerListResult->any; 得到字符串,然后用正则函数、字符函数把字符串处理好,再入库
------解决方案--------------------

PHP code
$s = $v) {
  $res[] = array(
    'price' => $v,
    'email' => $r[2][$i],
    'date' => date('Y-m-d H:i:s', strtotime(str_replace('T', ' ', $r[3][$i]))),
    'customer' => $r[4][$i],
    );
}
print_r($res); <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template