Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

remove array element php

$arr1 = array(
    'geeks', // [0]
    'for', // [1]
    'geeks' // [2]
);
  
// remove item at index 1 which is 'for'
unset($arr1[1]);  
  
// Re-index the array elements
$arr2 = array_values($arr1);
  
// Print re-indexed array
var_dump($arr1);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #array #element #php
ADD COMMENT
Topic
Name
6+8 =