James James - 1 year ago 90
PHP Question

Is value In_array?

I had a php function that checked for the presence of a URL parameter in the

array. This was all working fine, I have made some changes which modified the array (now looks like
) into a multi dimensional array.

Can I not use in_array with an array like this? Any help would be appreciated, I simply need the find value function to see if tje SRID parameter is in first level of

$old_example = array(

$array = array(1) {
array(2) {
string(9) "example1"
string(10) "example2"

// Find Value Function

if (in_array($_GET['srid'], $array)) {
echo "value found";

Fky Fky
Answer Source


if (in_array($_GET['srid'], array_keys($array))) {
  echo "value found";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download