Home Karmen For You Tuts Games xoxo updates Res Listed Credits LinkMe Cbox

PHP: Random Quote

If you’re looking for a simple “random quote” to add on your site, this is for you. You will need to be able to use PHP on your website and have pages with a .php extension, so make sure of that first.

The Code

Paste the following code into a fresh, new document.

Save the document as quotes.php.
Editing the code Replace Quote here with your quote. You can use HTML such to make part of the font bold or use a line break to make a new line.
If you want more quotes, copy the line $quotes[] = "Quote here";.
If you want less quotes, simply delete one of the lines.
Note: If you would like to use double quotes (“) within your quotes, place a backslash (\) before it. For example:

Or you can just use single quotes.
Putting it on your page
Find the page where you want the random quote to appear.
Simply paste this PHP include:

Upload both files to your website and it should work.
If this has helped you and you use it. Please Link back. I really worked hard on this and to be able to Provide it to you.. thank you!!