Jump to content

Archived

This topic is now archived and is closed to further replies.

member

Simple code for font needed

Recommended Posts

Hi,

i need a simple code for each part for the font style, size and colour.

here is the code:
---------------------------------------
[code]
<?php
// next two lines get the server start time for execution
$starttime = explode(' ', microtime());
$starttime = (float)$starttime[1] + (float)$starttime[0];

echo "<a href='". $_SERVER['PHP_SELF']. "'>another saying</a><hr/>"; // refreshes page

// this is the real meat of the script
$list = array("allah_says1.txt", "allah_says2.txt", "allah_says3.txt"); // as many files as you want to have
$thefile = $list[rand(0,count($list)-1)]; // select a random text file
$sayings = file($thefile); // read entire file into an array
$saythis = $sayings[rand(0,count($sayings)-1)]; // select a random array element

// this replaces the <><><>#<><><> delimiters
$saythis = preg_replace('|<><><>[0-9]{1,4}<><><>|', '', $saythis);

echo nl2br($saythis); // output the random saying

// get the server end time for execution and output the time taken
$endtime = explode(' ', microtime());
$endtime = (float)$endtime[1] + (float)$endtime[0];
$totaltime = number_format(($endtime - $starttime), 4, '.', '');
echo "<hr><p>My server generated this page in <font color='red'><strong>$totaltime seconds</strong></font> from a text file with ". count($sayings). " sayings.</p>";
?>[/code]

----------------------------------------------------------------------

When I say "part" as above I mean:

Visit: http://islamcentre.awardspace.com/test/test.php

I want all the parts where it says "Narrated..." to be say green
and the main quote (middle part) to be say.. yellow
and the Book Number as at the bottom (not right at the bottom) to be Blue

I have given the code above to help u as i don't understand which bit goes with what.

If anyone could help it would be most appreciated.
OR if u can't do it but can give me the code to do this for the whole text it would be great .

thanks

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.