the_oliver Posted June 9, 2007 Share Posted June 9, 2007 Hello, Im looking for a way to split a string into an array. Eg: if the string was name,name1,name2 i would split it so that each part of the array read name name1 name2 Thanks! Quote Link to comment Share on other sites More sharing options...
jscix Posted June 9, 2007 Share Posted June 9, 2007 $arr = explode("," , $yourstring); Quote Link to comment Share on other sites More sharing options...
AndyB Posted June 9, 2007 Share Posted June 9, 2007 In the example you give, you don't want to split the string you want to replace each comma with a space. $new_string = str_replace(","," ",$string); Quote Link to comment 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.