RE: Processing time in PHP. better to use php tags inline or pri nt("<html>");

From: Date: Wed, 16 May 2001 16:39:43 +0000
Subject: RE: Processing time in PHP. better to use php tags inline or pri nt("<html>");
Groups: php.general 
Request: Send a blank email to php-general+get-53060@lists.php.net to get a copy of this message
Sorry to nag, i hadnt recieved any responses on this post yet.. would like to re-request.. I wanted to know if there is drawbacks or benefits to using the php alternate syntax? > 1.) Is it possible (and if so, how do i) get the time it took to process > the page (seconds or milliseconds)? > > 2.) This is where the first q arose from: I am trying to ascertain which > is faster, outputting a query using the print function or using the > alternate syntax. I know that in ASP, jumping in and out of the asp code > slows down the page processing. > > Here is the two ways i am outputting my recordset: > > 1.----- from within the php code ----- > > <table cellpadding="4" cellspacing="4" border="2"> > <?php > > for ($i = 1; $i <= $nr; $i++){ > $row = mysql_fetch_assoc ($rs); > > print("<tr>"); > print("<td>"); > print($row['projectId']); > print("</td><td>"); > print('<a > > href="mylink.php?linkId='.$row['projectId'].'">'.$row['projectName'].'</a> > '); > print("</td><td>"); > print($row['projectStatus']); > print("</tr>"); > > } // End Loop rows > > ?> > > </table> > > > 2.------------ inline code with the html -------------- > > <table cellpadding="4" cellspacing="4" border="2"> > <? for ($i = 1; $i <= $nr; $i++): ?> > <? $row = mysql_fetch_assoc ($rs);?> > <tr> > <td><?print($row['projectId']);?></td> > <td><a > > href="myfile?blah=<?=$row['projectId']?>"><?print($row['projectName']);?>< > /a></td> > <td><?print($row['projectStatus']);?></td> > </tr> > <? endfor; ?> > </table> > > Any thoughts from the experts? I love being able to mix html and php tags, > but am worried about efficiency. > > TIA, > > Quinn Merio > Vir2lAlliance Inc. > www.vir2lalliance.com > >

« previous php.general (#53060) next »