removing one element from an array
Posted: Sun Aug 18, 2002 7:04 pm
I am trying to remove an element from an array by using array_splice. If this is wrong then please tell me.
I have re-read the php manual several times but still this doesn't work
I have tried one other variation where I just use $key_id instead of (1+$key_id)
any ideas?
I have re-read the php manual several times but still this doesn't work
Code: Select all
$key_id = array_search($student_id, $student_list);
if (!$key_id) {
echo "There was an error. Student not found in student list.";
}
echo "key_id is: ".$key_id;
$student_list = array_splice($student_list, (1+$key_id), 1);any ideas?