Recent Posts

How to: Delete an element from Array PHP



You can use unset

<?php
$x = array(1, 2);
unset($x[0]);
var_dump($x);
?>
This is the output: 

array(1) {
  [1]=>
  int(2)
}

No comments:

Post a Comment