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

1번째 줄: 1번째 줄:
==trim_arr==
<source lang='php'>
function trim_arr($arr, $removeEmpty = false) {
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>
==xmp_print_r==
==xmp_print_r==
<source lang='php'>
<source lang='php'>
function xmp_print_r($arr) {
function xmp_print_r($arr) {
  echo '<xmp>';
echo '<xmp>';
  print_r($arr);
print_r($arr);
  echo '</xmp>';
echo '</xmp>';
}
}
</source>
</source>

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

1 trim_arr

function trim_arr($arr, $removeEmpty = false) {
	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;
}

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 }}