I have an array about 1000 values, I’ve just shuffled them using shuffle(). Now I want to echo the shuffled results. But here’s the catch, can it be done without looping through the array or displaying array ‘syntax’?
ie:
<?php
$myarray = array('a','b','c','d');
shuffle($myarray);
echo array_echo_vals_only($myarray);
/*
should echo: dbca
*/
?>
Simply Use
ImplodeOr Just reduce the array with
array_reducePlay around with
vsprintfWe also have some crazy ways ..
Or
What i think ….
Loop is not a bad solution .. you may as well give it a try … Example :