Jump to content

Simple code for font needed


member

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.