P粉8659009942023-09-03 09:09:04
As mentioned in the comments, just create an array and shuffle it.
$images = []; for ($l = 1; $l <= 45; $l++) { $images[] = "<div class='thumb' style='background-image: url(l{$l}.jpg);'></div>"; } shuffle($images); echo implode("\n", $images);