I have a comma separated string that I want to convert into an array so I can loop through it.
Is there anything built-in to do this?
I have a comma separated string that I want to convert into an array so I can loop through it.
Is there anything built-in to do this?
The split() method is used to split a string into an array of substrings, and returns the new array.
var array = string.split(',');
In javascript and PHP you have these two very powerful functions:
JS: String.split(String) Array.join(String);
PHP: explode(string,string) implode(string,array)