member Posted September 14, 2006 Share Posted September 14, 2006 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.phpI want all the parts where it says "Narrated..." to be say greenand the main quote (middle part) to be say.. yellowand the Book Number as at the bottom (not right at the bottom) to be BlueI 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.