- <?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);
- ?>
運行結果:php