【发布时间】:2017-07-14 05:08:57
【问题描述】:
我的 JSON 响应看起来像这样
(
[0] => stdClass Object
(
[default] => false
[loc] => http://somethingirrelevant.lol
[temp] => '100'
)
)
我想要完成的是将[LOC] 中的网址更改为https
我尝试使用:
$array = preg_replace('http','https' $array);
但这完全破坏了数组!
【问题讨论】:
标签: php arrays preg-replace