I am using a simple php script to look for an element in an array like
$restricted = array('root/base', 'root2' );
print_r($restricted);
if( array_search('root/base', $restricted) ){
echo "1";
} else {
echo "0";
}
But I am always getting the following output
Array ( [0] => root/base [1] => root2 ) 0
This means that the array_search is failing to find the element in the given array. Can anybody show some light on whats happening?
I tried to replace array_search() with in_array() also. But that too returned the same error.