JavaScript Equivalent of PHP Explode Functionby: Amrit HallanJavaScript equivalent of PHP explode function In PHP we can easily break a long string into smaller parts by using the explode() function of PHP. In run rime, this function works like this:
After the execution of the second command the variable $brokenstring is an array such that, $brokenstring[0]=”Most” and so on. So how do we do it in JavaScript. In JavaScript there is a split() function that achieves the same objective, although the syntax is a bit different.
Now the variable brokenstring has all those words. © 2008 NetVisits, Inc. All rights reserved. |