Foreach with multiple arrays custom field
-
$href = array('https://www.youtube.com/watch?v=yC3_gkdtlua', 'https://www.youtube.com/watch?v=yC3_gkdtlub', 'https://www.youtube.com/watch?v=yC3_gkdtluc', 'https://www.youtube.com/watch?v=yC3_gkdtlud'); $name = array('1', '2', '3', '4');
How do I make it so that I can combine both arrays to make a link?
I want the output to be:<a href="https://www.youtube.com/watch?v=yC3_gkdtlua">1</a> <a href="https://www.youtube.com/watch?v=yC3_gkdtlub">2</a> <a href="https://www.youtube.com/watch?v=yC3_gkdtluc">3</a> <a href="https://www.youtube.com/watch?v=yC3_gkdtlud">4</a>
Foreach only works with one array. This is the entire code:
[Code moderated as per the Forum Rules. Please use the pastebin]
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘Foreach with multiple arrays custom field’ is closed to new replies.