changing $font variable
Posted: Thu May 07, 2009 11:50 am
I'd like to change the font of a webpage every 25 seconds (in order to decide between a number of options).
I tried this, but it's definetly not working:
PS I did not forget that I have to click the refresh button. What did I do wrong?
I tried this, but it's definetly not working:
Code: Select all
<?php
$i = 0;
$fonts = array('Trebuchet MS', 'Arial', 'Helvetica', 'sans-serif', 'Verdana', 'Georgia', 'Tahoma', 'Palatino', 'Gill Sans');
$font = $fonts[$i];
echo 'style="font-family: '.$font.';">';
$i = ($i + 1) % 9;
if (time() % 25 == 0) {
$i += 1;}
?>