Random Quote Generator

Generate Quote Online, Click "Generate"

Code


// Bruzu API key get yours at https://bruzu.com
$apiKey = "BRUZU-YOURKEY";
// Get random quote text
$quote= json_decode(file_get_contents("http://api.quotable.io/random"),true);

$params = array(            
    "backgroundImage"=>"https://source.unsplash.com/500x500/?wallpaper",
    "backgroundImage.opacity"=>0.8,
    "backgroundColor"=> "black", 
    "a.text"=>  $quote['content'],
    "a.color"=>"#ffffff",        
    "a.fontFamily"=>  "Poppins", 
    "a.shadow"=>  "1px 1px 1px black",
    "a.fontWeight"=> 800,        
    "apiKey"=>$apiKey       
);                  

$apiLink[]= "https://img.bruzu.com/?".http_build_query($params); 

$png = file_get_contents($apiLink."&ak=".$apiKey);
$imgLink = 'data:image/png;base64,' . base64_encode($png);
// You can use this link into your HTML code 
// <img src="<?=$imgLink?>" >

How to build a random quote generator? You can use the give PHP code.
AI quote generator? Why not, use GPT to generate quote and Bruzu API to generate Images
Inspirational images and quotes
Good Night images with quotes
Funny friday morning images and quotes
Christian quotes and images
Happy birthday images and quotes
Inspirational quotes with images