Jakez Posted June 1, 2009 Share Posted June 1, 2009 Ok so I have something like: Array ( [http://www.url.com/audio/60723620cc4eaa73/] => decripsdf sf asdf sdf [http://www.url.com/audio/6072363275d23388/] => description asf asdf asd ) And afterwards I need to be able to print out something using both the URL's and the text they hold, like: <a href=http://www.url.com/audio/60723620cc4eaa73/>decripsdf sf asdf sdf</a> <a href=http://www.url.com/audio/6072363275d23388/>description asf asdf asd</a> Problem is, I don't know how to do this because arrays confuse the hell out of me Link to comment https://forums.phpfreaks.com/topic/160422-solved-simple-problem-how-do-i-place-the-array-key-into-a-variable-so-i-can-use-it/ Share on other sites More sharing options...
btherl Posted June 1, 2009 Share Posted June 1, 2009 foreach ($array as $key => $value) { print "<a href='$key'>$value</a>"; } Link to comment https://forums.phpfreaks.com/topic/160422-solved-simple-problem-how-do-i-place-the-array-key-into-a-variable-so-i-can-use-it/#findComment-846520 Share on other sites More sharing options...
Jakez Posted June 1, 2009 Author Share Posted June 1, 2009 LOL, embarassing. Thanks. Link to comment https://forums.phpfreaks.com/topic/160422-solved-simple-problem-how-do-i-place-the-array-key-into-a-variable-so-i-can-use-it/#findComment-846530 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.