JavaScript split equivalent of PHP explode function

April 3, 2007 9 Comments

PHP 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

9 Responses to “JavaScript split equivalent of PHP explode function”

  1. 1
    Hsiu Taybron Says:

    Ya know, this is going to be pretty interesting. Seeing how this blog grows from 50 uniques a day to x,xxx+ (hopefully :D ).

  2. 2
    Kurtis Strole Says:

    Great tips! Thanks for posting this:-)

  3. 3
    Small Business Ideas Says:

    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.

  4. 4
    poker stars bonus codes Says:

    Nice tips. You did not write sponsoring contest. This gives you backlinks.

  5. 5
    poker stars bonus code Says:

    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.

  6. 6
    Wilber Boschult Says:

    I just thought I’d ask a small number cool kids if they would care to take a stab at.

  7. 7
    equipement a sous sans telechargement Says:

    That is a newsworthy happening.

  8. 8
    casino en ligne francais Says:

    I do not fear that I should take it all in stride.

  9. 9
    astuce casino en ligne Says:

    These are some meaningful bits of info.

Leave a Reply

Powered by WP Hashcash

World Trade Center Building 7 was NOT hit by an aircraft.

9/11 Controlled Demolitions of September 11, 2001 World Trade Center Building 7 was NOT hit by an aircraft. This...

HAPPY DIWALI AND NEW YEAR, CELEBRATE Diwali

HAPPY DIWALI AND NEW YEAR TO U *. * . * . * . * . * . *...

Dipawali 2009 pooja time, Diwali Muhurats 2009, Auspicious time forLakshmi Puja

Diwali Pooja Muhurats, Auspicious time, Shubh Samay in 2009 Pushya Nakshatra October 12, 2009 is the ‘Pushya Nakshatra’ which...

Diwali sms, Free Diwali sms, Happy Diwali sms, Free Send Diwali sms

Diwali sms Diwali aai, masti chahi, rangi rangoli, Diwali aai, masti chahi, rangi rangoli, deep jalaye, Dhoom Dhadaka, chhoda...

Munna bhai Free SMS, Mobile Text Messages, Tapoti Style Akdom Zakasss

Tera bahot memory aa rela tha,Itna tem ho gela hai,tere ko dekha bhi nai,Akha life mei tere jesa 1...

Find Popular Searches in the web solutions Development Outsourcing

cheap internet marketing web design birmingham website hosting website submission ecommerce web hosting content management systems strategic internet marketing...

Some easy steps you can take to tackle a flu / swine flu virus of any kind

It is essential to remember that all kinds of viruses and bacteria can attack you when your immune system...

Mobile Phone Etiquettes – all good things should be enjoyed responsibly

We all love our mobiles… we talk, we text, we listen to music and we stay in touch.Can we...

Adsense Alternatives – available to webmasters wishing to monetize the web

Here are the Adsense Alternatives that are available to webmasters wishing to monetize the web! Adbrite AdEngage Adgenta Adhearus...

Worldwide Mobile Operator MMSC Settings – For receiving and sending MMS

Worldwide Mobile Operator MMSC Settings Setting For receiving and sending MMS From your mobile phone or GSM Modem [Albania...