mikwit Posted November 26, 2006 Share Posted November 26, 2006 Hello, I've been doing php stuff for a couple years now so I'm rather confused as to why this does not work,The main goal is to get a string with values separated by commas into an array and then for each value request a url specific to that valueheres the code I've made up, very simple (note that the string is a small sample of the actual string, which is something like 250 values)[code]<?$csv = "21 Grams 2003,2009 Lost Memories 2002,2046 2005,The 40-Year-Old Virgin 2005,Adrenaline Drive 2000,Advertising Rules 2001"$dvds = explode("," , $csv);foreach($dvds as $row){include("http://mikwit.com/dvds/add.php?title=" & $row);}?>[/code]I really thought it would work, but i get a "Parse error: parse error, unexpected T_STRING in /homepages/23/d114411700/htdocs/dvds/dvds.php on line xxx" with the line being that of "$dvds = explode("," , $csv);" Quote Link to comment https://forums.phpfreaks.com/topic/28537-explode-help/ Share on other sites More sharing options...
.josh Posted November 26, 2006 Share Posted November 26, 2006 you forgot the ; to end your $csv = "..." line. Quote Link to comment https://forums.phpfreaks.com/topic/28537-explode-help/#findComment-130578 Share on other sites More sharing options...
wildteen88 Posted November 26, 2006 Share Posted November 26, 2006 You forgot the all important semi-colon at the end of this line:[code]Advertising Rules 2001"[/code]C_V beat me :) Quote Link to comment https://forums.phpfreaks.com/topic/28537-explode-help/#findComment-130579 Share on other sites More sharing options...
kenrbnsn Posted November 26, 2006 Share Posted November 26, 2006 You forgot the semi-colon at then end of the quoted string.Ken Quote Link to comment https://forums.phpfreaks.com/topic/28537-explode-help/#findComment-130580 Share on other sites More sharing options...
.josh Posted November 26, 2006 Share Posted November 26, 2006 who's the quickest draw? Crayon is the quickest draw! blam blam blam! Quote Link to comment https://forums.phpfreaks.com/topic/28537-explode-help/#findComment-130581 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.