hi all,
new to php - old to programming.
i need to split a delimited string of values. i tried split but it split each character in the string into its own value in an array.
i need somethign like this:
"spaghetti, ice cream, borat"
in an array like
arr[0]spaghetti
arr[1]ice cream
arr[2]borat
how can i perform this ?
thanks,
mcm
Split an array on a delimiter
Moderator: General Moderators
Re: Split an array on a delimiter
Code: Select all
$str = "spaghetti, ice cream, borat";
$arr = explode(",", $str);