I have this code:
HTML checkbox names:
name="selection[]"
Code:
$selections = $_POST['selection'];
$selectionsview = implode("<br>", $selections);
echo $selectionsview;
This is just to preview the output, then:
$selectionsfull = implode(PHP_EOL, $selections);
I'm writing to a file using fpopen:
$fp = fopen('data.txt', 'w');
fwrite($fp, print_r($selectionsfull, TRUE));
fclose($fp);
But I can't seem to make the outputs shuffle. I've tried like 10 various methods of shuffling, but can't get it to work. Can you shuffle an imploded array? I also tried exploding first, but it errors out every time.
Thanks!