Source |
CodingSec |
Identifiant |
656 |
Date de publication |
2016-04-20 17:00:41 (vue: 2016-04-20 17:00:41) |
Titre |
How to put random quotes in php |
Texte |
Today in this article I am going to demonstrate you how to put a randomized quote in your website using php. You can use example below in many different situations, idea is to create a list of quotes in array, and using PHP array_rand(), we can pick random entries out of an array. <?php //array of short quotes (taken from http://www.curatedquotes.com/) $array_of_quotes = array( ‘I don\’t want to earn my living; I want to live.’, ‘Life shrinks or expands in proportion to one\’s courage.’, ‘Life must be lived forwards, but can only be understood backwards.’, ‘Be the change you wish |
Envoyé |
Oui |
Condensat |
$array ‘be ‘i ‘life ’s ’t //array appeared array article backwards below but can change coding com/ courage create curatedquotes demonstrate different don earn entries example expands first forwards from going how http://www idea list live lived living; many must one only out php pick post proportion put quote quotes rand random randomized security short shrinks situations taken today understood use using want website wish your |
Tags |
|
Stories |
|
Notes |
|
Move |
|