-
-
function array_multi2single($array) - {
- static $result_array=array();
- foreach($array as $value)
- {
- if(is_array($value))
- {
- array_multi2single($value);
- }
- else
- $result_array[]=$value;
- }
- return $result_array;
- }
//测试
- $array=array("1"=>array("A","B","C",array("D","E")),"2"=>array("F","G","H","I"));
- $array=array_multi2single($array);
- echo "
测试结果:";
- foreach($array as $value)
- {
- echo "
$value";
- echo "
";
- }
- ?>
-
复制代码
|