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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -