concatenate array and string variables in a php foreach -
is possible "glue" 2 variabels 1 in foreach? i've tried dot inbetween array_combine. give me errors... $coursefiles array, while $block[id] int.
<?php foreach($coursefiles . $block["id"] $coursefile): ?> <tr> <td><?php echo htmlentities($coursefile["exercise name"]) ?></td> <td><?php echo htmlentities($coursefile["logsheet"]) ?></td> <td><?php echo htmlentities($coursefile["ebf sheet"]) ?></td> </tr> <?php endforeach; ?>
try this:
$myvar = array(); // assign values $myvar array. $myvar[$index] = $coursefiles[$index] . $block["id"]; foreach($myvar $coursefile) { //some code }
Comments
Post a Comment