See that the index 2 is not in the array any more and the $my_array is not in the correct index sequence. you can reassign indexes using the array_values()
<?php
$my_array = array('Hello', 'Bye', 'Kusal', 'kuppiya');
unset($my_array[2]); // remove kusal from array
print_r($my_array);
/*
Result:
Array ( [0] => Hello [1] => Bye [3] => kuppiya )
*/
?>
No comments:
Post a Comment