Please note that array_splice() 's second argument is an OFFSET and not an INDEX.
Lets say you want to
$array_of_items = array ('nothing','myitem','hisitem','heritem');
$sid = array_search('myitem',$array_of_items);
echo $sid; /* prints out 1, since index element 1 is "myitem" */
Now, lets say we want to remove that "myitem" from the array:
<?php
$array_of_items = array_splice($array_of_items,(1+$sid),1);
?>
Notice how you have to add a one to the $sid variable? That is because offset item 1 is "nothing" and since $sid is currently 1 (the index of "myitem"), we add 1 more to it to find out
its OFFSET.
DO NOT DO THIS:
$array_of_items = array_splice($array_of_items,$sid,1);