It's better HTML in PHP or the opposite
Moderator: General Moderators
It's better HTML in PHP or the opposite
I am constructing a PHP Web Site, and I have some tables and forms and I want to know if it's better to use HTML inside PHP OR PHP inside HTML? Because the values of the tables and forms have to be variables. I would like to know which way the page will work faster?
Re: It's better HTML in PHP or the opposite
It's just about the same either way. And when people start touting the "it's more efficient/faster/whatever to do X than Y" know that it's a matter of a small amount of time and is negligible compared to the runtime of the entire script.
Try them both and pick whichever you like more.
Try them both and pick whichever you like more.
Re: It's better HTML in PHP or the opposite
Ok thanks for all, Don't you think that a little slow of speed in a large php system can have bad effects?
Re: It's better HTML in PHP or the opposite
If the only concern was about speed then yes, but 99% of the time people sacrifice readability and maintainability to gain a tiny bit of speed and those are much more important than the microseconds saved.
Re: It's better HTML in PHP or the opposite
I agree with tasairis 100%. One of the biggest benefits of PHP is that you really don't have to worry too much about optimization until it becomes an obvious problem. People call it "premature optimization". When you spend more time trying to make a site as fast as possible instead of making it as easy to work on and extend as possible.
Re: It's better HTML in PHP or the opposite
Thanks a lot for your replies I'm really thankful.