Jump to content

Explode help


mikwit

Recommended Posts

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 value
heres 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);"
Link to comment
https://forums.phpfreaks.com/topic/28537-explode-help/
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.