and
I have an assoc array of pubs in a list (row2)
some of the pubs in the list may or may not match the pubs in the pubs array. what i'm trying to do is loop through the pubs array and assign a 'yes' or 'no' value to a new variable (addpub) according to whether the pubs are on the publist array or not.
can anyone help me? here's the code i have so far, but at the moment it just defaults to addpub=yes
Code: Select all
while($row)
{
$i++;
extract($row);
foreach ($row2 as &$val) {
if ($val == $pub_id) {
$add_pub = 'no'; //assigns 'no' value to $add_pub_link if exists in crawl
break 2;
}
}
if (!isset ($add_pub) ) {
$add_pub = 'yes'; //assigns 'yes' value to $add_pub_link if not
}
...