Custom Array randomizer

Completado Publicado Apr 22, 2014 Pagado a la entrega
Completado

Need a custom array randomizer function.

-Start with a source array, like the 15 element example below.

-Array is built from results of sql db query. Usually less than 100 rows.

-Need to randomize the order of rows, similar to shuffle() - BUT, rows where the second element

"groupid" is non-null must always be kept together. They will always start out together also.

-Rows within each groupid must also be randomized within the group.

-Another way to look at it would be, two layers of randomizing the rows:

1) Treating all groups of matching (non-null) groupid as a sinlgle unit, randomize the row order.

2) Next, randomize the row order within each group of non-null groupid.

$original = array(

array('seq'=>1, 'groupid'=>null, ...),

array('seq'=>2, 'groupid'=>null, ...),

...

array('seq'=>13, 'groupid'=>1, ...),

array('seq'=>14, 'groupid'=>1, ...),

array('seq'=>15, 'groupid'=>null, ...),

);

PHP Arquitectura de software

Nº del proyecto: #5843155

Sobre el proyecto

8 propuestas Proyecto remoto Activo Apr 22, 2014

Adjudicado a:

unieyes48

hi, your array has two group is,one is null and othere has [login to view URL] you want to group null values at beganing or in the end. and randomize each null group values. and no null will group together and randomize. Más

$17 USD / hora
(31 comentarios)
4.5

8 freelancers están ofertando un promedio de $20 / hora por este trabajo

steven6

I can help you with this in 8 hours starting now. I have done similar php projects, some of them here on freelancer. Send me a message if interested. Thanks.

$26 USD / hora
(33 comentarios)
6.0
sachindradasun

Hi, I am an expert in PHP and algorithms. I am sure that I can handle this task. Ready to start now. Would you like to give me this opportunity? Thanks

$16 USD / hora
(23 comentarios)
4.1
uditiiita

A proposal has not yet been provided

$21 USD / hora
(17 comentarios)
4.1
softerbdX

we already work on https://www.freelancer.com/u/softerbdX.html why you chose us have 5/5 rating with 100% complete rate with here have a little company too so you can depend on us . We provide you industry standard Más

$26 USD / hora
(6 comentarios)
2.9
Iwasolution

Hi Thank you for your reply. I have reviewed your links and i am sure we can provide you a complete functional desired output. then model we have shown you is just an example that we understand the functionality Más

$22 USD / hora
(0 comentarios)
0.0
saquibali

A proposal has not yet been provided

$16 USD / hora
(0 comentarios)
0.0