Thread: array modifiers
View Single Post
  #1  
Old 02-27-2006, 09:38 PM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
array modifiers

Let's say I have an array:
PHP Code:
this.fuit={"apple","orange","bananna"}; 
and you want to add "pear" to the array.
What would it involve to get the array to look like:
PHP Code:
this.fuit={"apple","orange","bananna","pear"}; 
or
PHP Code:
this.fuit={"pear","apple","orange","bananna"}; 
or
PHP Code:
this.fuit={"apple","orange","pear","bananna"}; 
?

and what is involved in removing an item from an array of strings and having the array self-compress so there are no emty spaces, such as:
before
PHP Code:
this.fuit={"apple","orange","bananna"}; 
and after
PHP Code:
this.fuit={"apple","bananna"}; 
?
Reply With Quote