I have included a PHP script (via the html tool in VSD) :
<?php
function wordofday()
{
$filename = "phptest/words.txt";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
$array = explode("\n",$contents);
$date = date("z");
if($date > count($array))
{return $array[0]; }
else
{return $array[$date]; }
}
echo '<p> </p><p>'.wordofday().'</p>';
?>
function wordofday()
{
$filename = "phptest/words.txt";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
$array = explode("\n",$contents);
$date = date("z");
if($date > count($array))
{return $array[0]; }
else
{return $array[$date]; }
}
echo '<p> </p><p>'.wordofday().'</p>';
?>
The problem is that all it returns is the following :
count($array)) {return $array[0]; } else {return $array[$date]; } } echo '
'.wordofday().'
'; ?>
'.wordofday().'
'; ?>
i.e. everthing after the "greater than symbol"
I realise that in html this is a tag...but surely not within the php script?
I would appreciate any help....what is it I need to do, or what is it I am doign wrong?
Thanks!