Sort numbers in groups of numbers

Recommended Posts

Hi,

I need to sort variables in groups of up to 15 and put it in an array. For example:

\$exstract['center_tabOpBody_0'] =5

\$exstract['center_tabOpBody_1'] =6

\$exstract['center_tabOpBody_2'] =8

\$exstract['center_tabOpBody_3'] =1

Should yield:

ARRAY(

[0] = center_tabOpBody_1,center_tabOpBody_2,center_tabOpBody_3 // <-----15

[1] = center_tabOpBody_0 //<----5

)

Is there some simple function do do the "efficiency" sort?

Thanks,

Share on other sites

Not enough detail provided I'm afraid.

Share on other sites

Ok,

Let say I have a bunch of numbers and I want to sort

them in groups of up to 15.

Those numbers:

1,5,8,10,8,3

Result in:

1) 5,10

2) 8,1,3

3)8

Share on other sites

What is your criteria for sorting? It doesn't make sense.

Share on other sites

Ok, I try to explain what I'm doing to make it more clear.

I'm extracting data from a web site. The data I want arranged under "center_tabOpBody_XX" tags and each tag contains up to 15 elements.

Meaning:

center_tabOpBody_0 contains 10 elements

center_tabOpBody_1 contains 3 elements

and so on...

I can get only 15 elements per one ip before it get black listed so I need to arrange "center_tabOpBody_XX" in groups up to 15 elements total per group and then parse those groups individually, one proxy per group.

Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.