in this article, we will learn how to delete or unset array element from a specific position in PHP

Some steps you need to do

  • //lets create an array
  • //delete element from specific index
  • //retrieve all remaining elements



//lets create an array
$lang = array("laravel", "php", "jquery", "nodejs", "boostrap");

//delete element from 0 index

//retrieve all remaining elements
while (list ($key, $val) = each($lang)) {
    echo "$key -> $val <br>";


1 -> php
2 -> jquery
3 -> nodejs
4 -> boostrap