Javascript function like PHP explode function
Looking for an explode function in Javascript? JS has such a function, called split. Split take a string, and splits it by a separator, then return an array containing the result. So it works just like explode PHP function.
Example:
var mystring = 'test explode split string';
var myarray = mystring.split(" ");
Split array would have 4 elements: test, explode, split, string.
So javascript split function is the equivalent of explode function in PHP.
No comments:
Post a Comment