This is a discussion on "PHP "Hip hip array"" within the PHP Forum section. This forum, and the thread "PHP "Hip hip array" are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
PHP "Hip hip array"
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
PHP "Hip hip array"
Hello
I am creating a google site map and need to create some urls - the url works fine until I add the array quoted below, I then get this error- Parse error: syntax error, unexpected '.' in /home/visitdev/public_html/jamie.php on line 143 do { $town=str_replace(' ', '-',$row_rs_sitemapnamename['town']);$area=str_replace(' ', '-',$row_rs_sitemapnamename['area']); $_xml .="<url><loc>http://www.choosespain.com/ Quote:
} while ($row_rs_sitemapnamename = mysql_fetch_assoc($rs_townname)); Can anyone help me with this as I am pulling my hair out Jamie H |
|
|
|
#2
|
|||
|
|||
|
Re: PHP "Hip hip array"
Well whats the . 's for?
|
|
#3
|
|||
|
|||
|
Re: PHP "Hip hip array"
do { $town=str_replace(' ', '-',$row_rs_sitemapnamename['town']);$area=str_replace(' ', '-',$row_rs_sitemapnamename['area']);
$_xml .="<url><loc>http://www.choosespain.com/". $areaCornwall = array('Restormel', 'Carrick', 'North Cornwall', 'Kerrier', 'Penwith', 'Caradon' ); if(in_array($row_rs_sitemapnamename['area'], $areaCornwall)) { echo "Cornwall"; } else { echo "Devon"; } ."/". $area."/". $town."/accommodation</loc><lastmod>2006-04-10T07:51:05+00:00</lastmod><changefreq>daily</changefreq><priority>0.50</priority></url>\n"; } while ($row_rs_sitemapnamename = mysql_fetch_assoc($rs_townname)); Is the code more clearly, when I normally use it I would put <?php $areaCornwall = array('Restormel', 'Carrick', 'North Cornwall', 'Kerrier', 'Penwith', 'Caradon' ); if(in_array($row_rs_sitemapnamename['area'], $areaCornwall)) { echo "Cornwall"; } else { echo "Devon"; } ?> That did not work, so I tried ". script xyz ." The reason being I do not know what else to do, I have know idea of how to form it correctly. Jamie |
|
#4
|
|||
|
|||
|
Re: PHP "Hip hip array"
What's this line supposed to be doing?
|
|
#5
|
|||
|
|||
|
Re: PHP "Hip hip array"
Yep for sure...
|
![]() |
| Tags |
| php, quothip, hip, arrayquot |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Creating a "tag" system to find relevant "related" pages | MrQuestions | PHP Forum | 3 | Mar 20th, 2008 23:06 |
| [SOLVED] Show "Image" Depends On User "Status"? | Monie | Classic ASP | 6 | Oct 16th, 2007 01:22 |
| ? IS "meta name="robots" content="?" necessary in pages ? | Love2Java | Starting Out | 6 | Aug 8th, 2007 13:48 |
| window.opener.document["nameForm"].getElementById("someid").value; doesnt work | drpompeii | JavaScript Forum | 0 | Feb 17th, 2007 23:09 |
| Need to build a "Trip" or "Journey Planner" | jswebdev | PHP Forum | 4 | Dec 5th, 2005 23:22 |