Something like this would work:
$myalt = ['first' => 'firsttitle', 'second'=> 'second title', 'third' => 'third
title'];
shuffle($myalt);
foreach ($myalt as $title){
echo '<blockquote>title="'.$title.' "</blockquote>';
}
Mind you, you have to make sure your array is actually an array.
EDIT: this is what you want:
$myalt = ['first' => 'firsttitle', 'second'=> 'second title', 'third' => 'third
title'];
shuffle($myalt);
$joined = join(' ', $myalt);
echo '<img src="https://stackoverflow.com/questions/51347642/yy" title="'.$joined.' " >';
9
solved How to shuffle this in php