{
$result = '';
if(is_array($arr) && count($arr) > 0) {
foreach($arr as $key => $value) {
$tempValue = '\'\'';
if(is_null($value)) {
$value = 'null';
} else if(is_array($value)) {
$tempValue = self::arrayToString($value);
} else {
if(is_string($value)) {
$tempValue = '\'' . strval($value) . '\'';
} else {
$tempValue = strval($value);
}
}
if(is_string($key)) {
$result .= ('\'' . $key . '\'' . '=>' . $tempValue) . ',';
} else {
$result .= (strval($key) . '=>' . $tempValue) . ',';
}
}
if(strlen($result) > 0) {
$result = 'array(' . substr($result, 0, strlen($result) - 1) . ')';
} else {
$result = 'array()';
}
}
return $result;
}
505



被折叠的 条评论
为什么被折叠?



