替换该数组的值。
...
包含要提取元素的数组。 后面的数组里的值会覆盖前面的值。
返回值
返回一个数组。如果发生错误,将返回 NULL。
范例
Example #1 array_replace() 范例
<?php $base = array("orange", "banana", "apple", "raspberry"); $replacements = array(0 => "pineapple", 4 => "cherry"); $replacements2 = array(0 => "grape"); $basket = array_replace($base, $replacements, $replacements2); print_r($basket); ?>以上例程会输出:
Array ( [0] => grape [1] => banana [2] => apple [3] => raspberry [4] => cherry )以上就是php数组内容怎么实现替换的详细内容!
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did53919
php数组内容怎么实现替换
阅读:53次