Any simpler and more efficient way of writing this code?
This part is duplicated:


$orderBy = array_map(function() {
    return mt_rand();
}, range(1, count($id)));
array_multisort($orderBy, $id);



You apply the same logic to $id, $status, $online.

To eliminate duplication, you can move this common logic to a function with one parameter:

function reorder(&amp;$arr) {
    $orderBy = array_map(function() {
        return mt_rand();
    }, range(1, count($arr)));
    array_multisort($orderBy, $arr);
}
reorder($id);
reorder($status);
reorder($online);


Note that we pass the array by reference (&amp;$arr), because array_multisort does the same, and modifies the content of the array anyway.

UPDATE

As other answers and comments have pointed out, you could also eliminate the magic numbers and duplication when creating the $status array, for example like this:

$color1 = array("red", "no");
$color2 = array("green", "yes");
$num_color1 = 7;
$num_color2 = 3;
$status = array_fill(0, $num_color1, $color1)
          + array_fill($num_color1, $num_color2, $color2);