Hi There I am running this code currently,
<?php foreach($search_results as $rslt) : ?>
<?
$code = $rslt['code'];
if(array_key_exists($code, $short_list)) {
$set = "set";
}
?>
<div class="row <? echo $set;?>"></div>
What I am trying to achieve is that if the array equals the $rslt['code']
then give the div the class of set otherwise don't the array I checking against looks like this,
Array
(
[849650047] => Y
[849652539] => Y
[849652774] => Y
[849656557] => Y
[849652014] => Y
)
However every time I loop all my divs get set with the 'set' class? It should only be where the array_key equals the current $code