<? PHP /* ** @ Author: Xiaojiang * PHP implements var_export (); */ $ Arr = Array ("1", "2", "3" ); $ Arr1 = Array ('A' => Null , 'B' => Array ('1' => 3 )); Var_export ( $ Arr ); // Var_export ($ arr1 ); Function Varexport ( $ Arr ){ $ RET = "Array (" ; Foreach ( $ Arr As $ K => $ V ){ $ RET . = (Is_numeric ( $ K )? $ K :"'". $ K ."'" ); $ RET . = '=>' ; $ _ Type = Strtolower ( GetType ( $ V )); Switch ( $ _ Type ){ Case 'Integer ': $ RET . = $ V ."," ; Break ; Case 'Array ': $ RET . = Varexport ( $ V ).',' ; Break ; Case 'Null ': $ RET . = "Null ," ; Break ; Default : $ RET . = "'". $ V ."'," ; Break ;}} $ RET . = ")" ; Return $ RET ;} // Echo varexport ($ ARR ); Echo Varexport ( $ Arr ); // Bool is_numeric (mixed $ var) returns true if VaR is a numeric or numeric string; otherwise, false // is returned. Therefore, is_numeric cannot be used to verify whether it is of the int type... ?>