下面的代码如下我怎样才能改变命名的键关联数组
Array ([1] => Array (
[url] => example.com
[title] => Title.example
[snippet] => snippet.example
))
$blekkoArray = array();
foreach ($js->RESULT as $item)
{
$blekkoArray[$i]['url'] = str_replace ($find, '', ($item->{'Url'}));
$blekkoArray[$i]['title'] = ($item->{'url_title'});
$blekkoArray[$i]['snippet'] = ($item->{'snippet'});
$i++;
}
print_r ($blekkoArray);
我怎样才能修改数组返回一个关联数组所以不是数组元素已经确定由1,2,3
等它会通过网址确定例如。
Array ([example.com] => Array (
[title] => Title.example
[snippet] => snippet.example
))
没错这个完美工作,感谢 –