How can I check if $something['say']
has the value of 'bla'
or 'omg'
?
$something = array('say' => 'bla', 'say' => 'omg');
Using if
?
if(isset($something['say']) && $something['say'] == 'bla') {
// do something
}
Btw, you are assigning an value with the key say
twice, hence your array will result in an array with only one value.
You could use the PHP in_array function
if( in_array( "bla" ,$yourarray ) )
{
echo "has bla";
}