Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head><title>Random Quote</title></head>
- <body>
- <h1>Random John Muir Quote Page</h1>
- <?php
- function getQuote($r_num) {
- $quotes = array();
- $quotes[0] = "The mountains are calling and I must go!";
- $quotes[1] = "Between every two pines is a doorway to a new world!";
- $quotes[2] = "The power of imagination makes us infinite!";
- $quotes[3] = "In every walk with nature, one receives far more than he seeks!";
- $quotes[4] = "Climb a mountain or spend a week in the woods, washing your spirit clean!";
- $quotes[5] = "Of all the paths you take in life, make sure a few of them are dirt! ";
- $quotes[6] = "Into the forest I go, to lose my mind and my soul!";
- $quotes[7] = "Nothing truly wild is unclean!";
- return $quotes[$r_num];
- }
- echo "Quote of the day!<br/><br/>";
- $randomNumber = rand(0,7);
- $randomQuote = getQuote($randomNumber);
- echo "<h2>$randomQuote ~John Muir</h2>";
- echo "<br/><br/><hr/>";
- echo "<h2>The current date is " . date('l F jS, Y');
- $month = date("m");
- $day = date("d");
- $year = date("Y");
- $now = mktime(0,0,0,$month,$day,$year);
- $then = mktime(0,0,0,04,21,2020);
- $gap = $then - $now;
- $gap = round($gap/(60*60*24));
- echo " Come celebrate Earth Day with us on John Muir's birthday <br/>";
- echo "April 21st - <strong>$gap</strong> days from today! </h2>";
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement