randomize array using php

Posted by Suneth Kalhara on Stack Overflow See other posts from Stack Overflow or by Suneth Kalhara
Published on 2012-07-09T09:06:01Z Indexed on 2012/07/09 9:15 UTC
Read the original article Hit count: 323

Filed under:
|

I need to rendomise the order of follow array using PHP, i tried to use array shuffle and array_random but no luck, can anyone help me please

Array (
  [0] => Array (
    [value] => 4
    [label] => GasGas
  )
  [1] => Array (
    [value] => 3
    [label] => Airoh Helmets
  )
  [2] => Array (
    [value] => 12
    [label] => XCiting Trials Wear
  )
  [3] => Array (
    [value] => 11
    [label] => Hebo Trials
  )
  [4] => Array (
    [value] => 10
    [label] => Jitsie Products
  )
  [5] => Array (
    [value] => 9
    [label] => Diadora Boots
  )
  [6] => Array (
    [value] => 8
    [label] => S3 Performance
  )
  [7] => Array (
    [value] => 7
    [label] => Scorpa
  )
  [8] => Array (
    [value] => 6
    [label] => Inspired
  )
  [9] => Array (
    [value] => 5
    [label] => Oset
  )
) 

© Stack Overflow or respective owner

Related posts about php

Related posts about multidimensional-array