Hello,
I found two type of php sites one print all html like that:
print '<div> ....
and other is html and then embed php inside with <?php ?>
which is better for developer ? faster ? and easier ? or when I should use one method over another ?
Thanks
wich is better print 'html' or html with <?php ?> inside ?
Moderator: General Moderators
Re: wich is better print 'html' or html with <?php ?> inside ?
It doesn't really make much difference, except in ease of reading the code. In principle, requiring the PHP parser to read more bytes is probably slower, but I doubt that you could measure the difference.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: wich is better print 'html' or html with <?php ?> inside ?
I think in general you should only be using echo/print and embedding PHP in HTML in templates. Otherwise the only print would be:
Code: Select all
echo $template->render();(#10850)
Re: wich is better print 'html' or html with <?php ?> inside ?
thanks for replies