Recent Posts

Showing posts with label unset. Show all posts
Showing posts with label unset. Show all 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)
}