-
-
/** - desc:递归替换数组内容
- link:bbs.it-home.org
- date:2013/2/22
- */
- function arrContentReplact($array)
- {
- if(is_array($array))
- {
- foreach($array as $k => $v)
- {
- $array[$k] = arrContentReplact($array[$k]);
- }
- }else
- {
- $array = str_replace(
- array('<', '>'),
- array('{', '}'),
- $array
- );
- }
- return $array;
- }
//调用示例
- $arr = array(array("< jbxue1>","< jb2xue>",array("",array(""))),"< jb33xue>","< jbxue44>","< 44jbxue>");
- $arr3 = arrContentReplact($arr);
- echo "
";</li>
<li>print_r($arr3);</li>
<li>echo " ";
- ?>
-
复制代码
|