RE: [PHP] Re: Script optimisation
| From: | Tony Crockford | Date: | Wed, 16 Oct 2002 09:21:42 +0000 |
| Subject: | RE: [PHP] Re: Script optimisation | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-120150@lists.php.net to get a copy of this message | ||
> As I said at the start, it very much depends on what is required for a
> particular script...
>
Here's an area I'm struggling with:
(it's a breadcrumb trail building <a href from variables according to
which page I'm creating):
<?php
//index
echo "<a href=\"", $urltoitem, "/tm", $cat1_ref, "/lv",
$count_levels,
"/index.htm\">";
getcat1name($cat1_ref);
echo "</a><br /><img src=\"img/dar.gif\" alt=\" \"
/><br />";
//subcat1
echo "<a href=\"", $urltoitem, "/tm", $cat1_ref, "/lv",
$count_levels,
"/s", $sub_cat1_ref, ".htm\">";
getsub_cat1name($sub_cat1_ref);
echo "</a><br /><img src=\"img/dar.gif\" alt=\" \"
/><br />";
//cat2
echo "<a href=\"", $urltoitem, "/tm", $cat1_ref, "/lv",
$count_levels,
"/s", $sub_cat1_ref, "-c", $cat2_ref, ".htm\">";
getcat2name($cat2_ref);
echo "</a><br /><img src=\"img/dar.gif\" alt=\" \"
/><br />";
//subcat2
echo "<a href=\"", $urltoitem, "/tm", $cat1_ref, "/lv",
$count_levels,
"/s", $sub_cat1_ref, "-c", $cat2_ref, "-sc",
$sub_cat2_ref,".htm\">";
getsub_cat2name($sub_cat2_ref);
echo "</a>";
?>
every time I mess with the "--" and '--' I end up getting an error or no
output.
from what you're saying this would be a slow part of the script and as
I'm generating nearly 4000 pages atm it would be good to speed this bit
up.
how would you do it?
TIA
Tony