<?php
// Create a array in PHP .
$array = array(1, 2, 3, 4, 5);
print_r($array); // prient array value HERE
echo '<br> unset array <br>' ;
// Now unset all array element
foreach ($array as $i => $value) {
unset($array[$i]);
}
//print_r($array);
// Append an item (after $array[4] , next value store in $array[5] ).
echo '<br> echo appending array <br>' ;
$array[] = 6;
print_r($array);
// Restart index
echo '<br> echo Restart index array <br>' ;
$array = array_values($array);
$array[] = 7;
print_r($array);
?>
Comments
Post a Comment
If you Satisfied , Please Leave a comment