A function I have written to accept filenames, read it and phrase it's mark
ups. Is the second function of one line file a good idea ? Is there an
alternative ? Can problems arise if the size of the file being phrased is
very large ?
==================================
<?php
//Phrases Files. Acknoledges certains special mark-ups if present.
function phrase($file)
{
$output=onelinefile($file);
$output=str_replace("[TITLE]",": ".$GLOBALS["title"],$output);
$output=str_replace("[LOGO]",onelinefile("_logos"),$output);
$output=str_replace("[COPYRIGHT]","Copyright (C) 2002
Findmaan.",$output);
return $output;
}
//reads a file and returns a variable with the entire file in one line.
function onelinefile($file)
{
$fa=file($file);
$i=0;
do
{
$output=$output.$fa[$i];
$i++;
}while($i<count($fa));
return $output;
}
?>
=========================
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php