- <?php
- function arrayChange($a){
- static $arr2;
- foreach($a as $v){
- if(is_array($v)){
- arrayChange($v);
- }
- else{
- $arr2[]=$v;
- }
- }
- return $arr2;
- }
- //======测试内容========
- $arr=array(
- 1=>"12",
- 2=>array("cc","dd"),
- 3=>array("34","ff"),
- );
- $arr003=arrayChange($arr);
- echo "<pre>";
- print_r($arr003);
- ?>
运行结果: