Answers for "echo random array in for loop php"

PHP
8

array random php

<?php
$indexedArray = array("red", "blue", "green", "black");
echo $indexedArray[array_rand($indexedArray)];
?>
Posted by: Guest on September-11-2021
0

php foreach random

shuffle($umm);
foreach($umm as $new){
    echo '<img src="'.$new->picture.'" width="100" />';
    echo $new->id;
}
Posted by: Guest on May-02-2021

Browse Popular Code Answers by Language