如何从以下关联数组中删除字符串 href


How to remove the string href from the following associative array?

我有以下标题为 $arr 的数组:

Array(
    [0] => Array
        (
[url] =>  href="http://52.1.47.143/file/attachment/2015/03/a4ea5532b83a56bbbae2fffc80de4fee.png"
        )
[1] => Array
        (
[url] =>  href="http://52.1.47.143/feed/download/year_2015/month_03/file_1b87d4420c693f2bbdf738cbf2457d89.pdf"        )
) 

不想在我想要的内容中使用字符串 href 以下数组:

Array(
    [0] => Array
        (
[url] =>  http://52.1.47.143/file/attachment/2015/03/a4ea5532b83a56bbbae2fffc80de4fee.png
        )
[1] => Array
        (
[url] =>  http://52.1.47.143/feed/download/year_2015/month_03/file_1b87d4420c693f2bbdf738cbf2457d89.pdf        )
) 

我应该怎么做?

试试这个:

foreach ($array as $str) {
    $str = str_replace('href=','',$str);
}

编辑:

您可以在 str_replace() 函数中使用数组。喜欢这个:

foreach ($array as $str) {
    $str = str_replace(array('href=','"'),'',$str);
}