Is there a way to add some kind of parameters to array (yet unknown variables)? As you can see here, i dont know the userID in advance (before the mysql fetch), so i cant properly form a link leading to edit page.
<?php
$box = array ('1'=>"<a href='edit.php?id=/PROBLEM??/'>edit</a>",'2'=>'Cannot edit');
while ($row = mysql_fetch_array($something)) {
?>
<tr>
<td><?php echo $row["Name"]; ?></td>
<td><?php echo $box[$row["editable"]]; ?></td>
</tr>
<?php
}
?>
$row[“editable”] returns 1 or 2, depends on database record which
returns if user is editable or not.
You can use
sprintf():