My name is Andrew Winter, and I have been what I like to refer to as a web hobbiest
for more than twenty years. Specializing in simple, brochure-type websites,
I’ve been building websites for friends and family for many many years. I’ve added PHP & MySQL programming to help in my design projects, and have created
several web applications mostly in the field of Broadcast Communications. Almost all of my websites are mobile-friendly using a mobile-first technology called
Bootstrap.
I created ADW Internet Solutions, to help showcase my work and offer my services to other hobbyist and small businesses who may want a web presence, but need
a little help, or can’t afford developer rates. I can help you establish an online presence that is not only simple, but functional, informative, and will
compliment your business passion. It would be my pleasure to speak with you about how I can help your business reach its online goals.
My Quote Generator simply displays a random quote from a collection of quotes compiled in a json
file. You can add or delete quotes as you wish by simply editing
the json
file directly.
<?php
function getQuote()
{
srand(mktime());
$quotes = file_get_contents("quotes.json");
$quotes = json_decode($quotes, true);
$seed = rand(0, sizeof($quotes)-1);
$current_quote = $quotes[$seed];
return($current_quote);
}
?>
<?php
require_once("quote_generator.php");
$quote = getQuote();
?>
The $quote
variable now contains your random quote to display on your website
The syntax is as follows:
$quote["desc"]
$quote["byline"]
<?php echo $quote["desc"]; ?>
or <?php echo $quote["byline"]; ?>