Jump to content

Beginnner needs help with For Each


justinomaha

Recommended Posts

I'm very new to programming so I apologize in advance if this is a stupid question!

 

I'm need the results of a for each loop saved as a variable. Here is what I'm trying:

 

$sitemap = "foreach( $finalurl as $key => $value){

echo  '<url><loc>http://www.$mainsiteurl.com/$finalurl[$key]</loc><changefreq>daily</changefreq><priority>0.9</priority></url>';

}";

 

Does anyone know how to do this? Thanks for anyone's help!

Link to comment
https://forums.phpfreaks.com/topic/158619-beginnner-needs-help-with-for-each/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.