/t5/dreamweaver-discussions/php-random-images-function/td-p/52131Oct 27, 2006
Oct 27, 2006
Copy link to clipboard
Copied
I had made a php random image function and the problem I have
at this moment is I don't want to change the "4" number to a "5"
because I included another image. Is there a value where the "4" is
some php function so I do not need to always update?
/t5/dreamweaver-discussions/php-random-images-function/m-p/52132#M147443Oct 27, 2006
Oct 27, 2006
Copy link to clipboard
Copied
.oO(AdonaiEchad)
>I had made a php random image function and the problem I
have at this moment is
>I don't want to change the "4" number to a "5" because I
included another
>image. Is there a value where the "4" is some php
function so I do not need to
>always update?
>
> <?php
> $roll = rand(1,4);
> print "<img src = randImages/Bn$roll.jpg>";
> ?>
glob() searches a given directory for filenames matching the
wildcard
pattern (in this case *.jpg). It returns an array with all
found
filenames. count() then simply returns the array's size and
passes it to
rand().