Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Undefined array key after unset()

//When unset() is used it unsets the array keys. 
//To reset the keys of an array you can use the array_merge(). 
//It's like magic
 
$array = array('a', 'b', 'c', 'd'); 
unset($array[2]); 

$array = array_merge($array);

Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Undefined #array #key
ADD COMMENT
Topic
Name
8+9 =