Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Random Width/Height and Random Rotation

$
0
0

Hi, 

New coder here! I'm making a php If loop that will post my image a set number of times (depending on user input in a text box), and I have that all figured out. However, I can't figure out how to rotate the image a random amount of degrees and have a random width/height for each image. Will rand generate new numbers for each time the image is echo-ed, or will it give the same number for all images?

 

This is what I have:

<?php

              function pic($picture) {

                        $degree = rand(0,360)

                        $num = rand(50,250)

                        $total = 0;
                        while ($total < $picture){
                            echo '<img src=blabla.gif width="$num" height="$num">';
                        $total = $total + 1;
                        }
                        
                    }
                        $picture = $_GET['input'];
                        $a = pic($picture);
                    }

?>

Thanks in advance!


Viewing all articles
Browse latest Browse all 13200

Trending Articles