Uffo Uffo - 1 year ago 143
PHP Question

How to check if an array value exists?

How can I check if

has the value of

$something = array('say' => 'bla', 'say' => 'omg');

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download