JavaScript split equivalent of PHP explode function
April 3, 2007 9 CommentsPHP Explode
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:
$longtext=â€This is a long text stringâ€;
$brokentext=explode(†“, $longtext);
After the execution of the second command the variable $brokentext is an array such that,
$brokentext[0]=â€Thisâ€
$brokentext[1]=â€isâ€
$brokentext[2]=â€aâ€
$brokentext[3]=â€longâ€
$brokentext[4]=â€textâ€
$brokentext[5]=â€stringâ€
Javascript Split
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.
var longtext=â€This is a long text stringâ€;
var brokentext=longtext.split(†“);
Now the variable brokentext has all those words.
Technology, Tips
June 18th, 2010 at 12:33 pm
Ya know, this is going to be pretty interesting. Seeing how this blog grows from 50 uniques a day to x,xxx+ (hopefully
).
June 18th, 2010 at 2:09 pm
Great tips! Thanks for posting this:-)
June 25th, 2010 at 10:50 am
Now more that ever you can’t afford to just sit back as your competitors will be working overtime to make as much money as they were pre-recession.
July 1st, 2010 at 1:40 pm
Nice tips. You did not write sponsoring contest. This gives you backlinks.
July 1st, 2010 at 2:49 pm
I so agree with this comment. If you have limited resources and limited budget a tutorial on how to go about it would be great. I am a newbie Internet Marketer with my first blog.
August 30th, 2010 at 4:41 pm
I just thought I’d ask a small number cool kids if they would care to take a stab at.
August 31st, 2010 at 3:47 am
That is a newsworthy happening.
August 31st, 2010 at 4:46 am
I do not fear that I should take it all in stride.
August 31st, 2010 at 2:54 pm
These are some meaningful bits of info.