PDA

View Full Version : array member return limit function?


Chompy
12-17-2006, 05:44 PM
Well, I have no idea what I wrote in the title, well let me explain:


temp.arr = { "foo", "bar", "baz"};
temp.new_arr = returnarraylength( temp.arr, 1, 2);

echo( temp.new_arr); // would return bar,baz


temp.new_arr would like produce { "bar", "baz"}
but is there a way to do this without loops or?

Well, this looks like a suggestion, I would like it to be added, but is there a way to do this?
(the example is the suggestion)

WanDaMan
12-17-2006, 06:05 PM
Are you wanting to know how many charactors there is used within the array?

Chompy
12-17-2006, 06:15 PM
Are you wanting to know how many charactors there is used within the array?

Nope, I want to return a length specified in an array..

Example:

If I had an array containing { 1, 2, 3, 4, 5, 6}; I would like to return a length of the array,
I would like to return like { 2, 3, 4, 5}; of the current array, is there an way to do this?

WanDaMan
12-17-2006, 06:22 PM
Nope, I want to return a length specified in an array..

Example:

If I had an array containing { 1, 2, 3, 4, 5, 6}; I would like to return a length of the array,
I would like to return like { 2, 3, 4, 5}; of the current array, is there an way to do this?

Oh, like this? This is what Andrew suggests...

temp.myArray = {"Test", "Hi", "Boo", "loltest", "Ahh"};
echo(temp.myArray.length() - (temp.myArray.size() - 1));

:confused:

Chompy
12-17-2006, 06:48 PM
Oh, like this? This is what Andrew suggests...



:confused:

That returned 19

Admins
12-17-2006, 07:09 PM
temp.arr.subarray(1,2) ?

Chompy
12-17-2006, 07:46 PM
temp.arr.subarray(1,2) ?

Perfect :D Just what I needed :)