php - Pulling two objects from two separate arrays in a foreach -
i'm sure i'm over-thinking this, steer me straight appreciated. need pull 2 array variables , place them in link can can apply them form in order change respective arrays (these links used pull recipient names , uid values stored in session arrays.) so, in foreach, "$contactlistunique $rec" line seems work fine in order pull username, need figure out way pull uid object. foreach operations don't allow multiple conditions, what's smartest way this?
<?php $contactlistuidunique = array_unique($_session['recipientlist']); $contactlistunique = array_unique($_session['contactlist']); foreach ($contactlistunique $rec) { echo "<font color=#808080><a href='removecontact.php?contact=$recuid&recipient=$rec' style='text-decoration: none'> <font color=#808080>" . $rec . "</a></font>"; } ?>
try though question not clear me
<?php $contactlistuidunique = array_unique($_session['recipientlist']); $contactlistunique = array_unique($_session['contactlist']); foreach ($contactlistunique $key=>$rec) { echo "<font color=#808080><a href='removecontact.php?contact=".$contactlistuidunique[$key]."&recipient=$rec' style='text-decoration: none'> <font color=#808080>" . $rec . "</a></font>"; } ?>
Comments
Post a Comment