Hey guys im trying to search an array for an value and then remove it. But im searching with a php variable and that seems to be the problem. So this is what I have so far:
if(isset($_REQUEST['Admin'])){
$arr = array('HAUGMA1', 'sdasd', 'dasdasda', 'sadasd');
$key=array_search($_REQUEST['Admin'],$arr);
if($key!==false)
unset($arr[$key]);
print_r($arr);
}
The $_REQUEST retrieves the value HAUGMA1 but when I print out the array it didn't remove HAUGMA1 from it. What am I doing wrong? When I'm using this:
$key=array_search('HAUGMA1',$arr);
It is working.
ifwrong. it should beif($key!=FALSE)HAUGMA1