Jump to content


Photo

Simple code for font needed


  • Please log in to reply
No replies to this topic

#1 member

member
  • Members
  • PipPipPip
  • Advanced Member
  • 58 posts

Posted 14 September 2006 - 08:43 PM

Hi,

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

here is the 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>";
?>

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

When I say "part" as above I mean:

Visit: http://islamcentre.a...m/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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users