"Lib arr.php"의 두 판 사이의 차이

1번째 줄: 1번째 줄:
==trim_arr==
==trim_arr==
<source lang='php'>
<source lang='php'>
function trim_arr($arr, $removeEmpty = false) {
$arr = array_map('trim', $arr);
if($removeEmpty == 'REMOVE_EMPTY')$removeEmpty = true;
$cnt = count($arr);
for($i=$cnt-1;$i>-1;$i--) {
$arr[$i] = trim($arr[$i]);
if($removeEmpty)array_splice($arr, $i, 1);
}
return $arr;
}
</source>
</source>



2012년 4월 13일 (금) 13:54 판

1 trim_arr

$arr = array_map('trim', $arr);

2 xmp_print_r

function xmp_print_r($arr) {
	echo '<xmp>';
	print_r($arr);
	echo '</xmp>';
}

3 xmp_var_dump

function xmp_var_dump($var)
{
	echo '<xmp>';
	var_dump($var);
	echo '</xmp>';	
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}