Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

An equivalent of PHP's explode() 1

Status
Not open for further replies.

DeepBlerg

Technical User
Jan 13, 2001
224
AU
Does FlashMX Actionscript have a function that works like explode() in php? I need to explode a variable at 1 point and thus create two variables. Any ideas?

Thanks.
 
What you need is the spilt(); function :

Code:
var myVar = "Fname|Sname";
var subArry = myVar.split("|");

The resultant output would be :

Code:
subArr[0] = "Fname";
subArr[1] = "Sname";

it works the same as the JavaScript split();

Regards

David Byng

spider.gif


davidbyng@hotmail.com

if (My Answer == "Good Post") {
print (
star.gif
);
}
 
Thanks for that Dave, by the way, is there a way to count the number of new vars in the array?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top