Does PHP code makes any difference in terms of optimizations?
Is writing the content text directly in the HTML better than doing <?php echo $my_contents; ?>
Amit
| SitePoint Sponsor |


Does PHP code makes any difference in terms of optimizations?
Is writing the content text directly in the HTML better than doing <?php echo $my_contents; ?>
Amit
It doesn't matter which server side technology drives your site - it's the generated html that gets read by search engines.


Search engines don't see the PHP code, they see the mark-up it outputs. Where the optimzation comes in is not with SEO, but with server resources. eg.
does not utilize the PHP parserHTML Code:<title>About</title>
does, andPHP Code:<title><? echo $page_title; ?></title>
might be a function that makes a database call.PHP Code:<title><? return_page_title($this_page); ?></title>
I imagine in most cases the cost in resources is acceptable, but it's still something to think about.

From the Search Engine Optimization FAQ:
What happens if I use includes for my pages? Will the search engines see them?
The search engines don't care about what server side technology you use. All they see is the (x)HTML your server side code generates. To see what they see simply load your page in your favorite web browser and then view the source. What you see is exactly what they see.
John Conde | Facebook | Twitter
Brainyminds Merchant Account Services I Love Code eBook Giant
Authorize.Net: AIM API | ARB API | CIM API Get the FREE code!
Merchant Accounts 101 | Ecommerce 101


thanks guys. Appreciated.
Bookmarks