shamsuljewel Posted November 29, 2007 Share Posted November 29, 2007 Hello everyone I can parse word by php using strpos and explode. How can I do this by javascript? suppose I have a string s = "abc&bcd&boddy"; so now I want to parse the words and save in an array[0] = abc array[1]=bcd and array[2] = boddy. so how can i do it? Quote Link to comment Share on other sites More sharing options...
shamsuljewel Posted November 29, 2007 Author Share Posted November 29, 2007 oppppsssssss that is so easy.... var mySplitResult = myString.split("&"); var results = new Array(); for(i = 0; i < mySplitResult.length; i++) { results[i] = mySplitResult[i]; //document.write("<br /> Element " + i + " = " + mySplitResult[i]); document.write(results[i]+'<br>'); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.