<?php
$my_array = array(5, "abc", null, 2.5, NULL, 0, "", false, 8);
print_r($my_array);
function is_notnull($v) {
return !is_null($v);
}
$remove_null_array = array_filter($my_array, "is_notnull");// remove null element
echo "<p>remove_null_array:<br />";
print_r($remove_null_array);
$reordered_array = array_values($remove_null_array);
echo "<p>reordered_array:<br />";
print_r($reordered_array); // reorder the array values
Saturday, November 28, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment