It really shouldn't be PHP vs HTML cause you can not compare between sun and the moon but you can compare between PHP vs ASP. Web pages are documents composed using HTML Markup while PHP is a Server-side scripting language that performs delivery and processing tasks. But generally some of the difference of PHP and HTML 1. PHP is similar to HTML because PHP having both HTML and PHP code. 2. HTML is a Tag language but PHP is a scripting language. 3. The output of PHP is mostly in HTML code because the web browser only sends HTML codes and PHP code always in background. 4. Actually web page takes two numbers, add it and present to user which easily done by PHP but which is not possible in HTML. You won't find any sites that are built with only PHP, because PHP by itself is not capable of rendering a web page without using HTML. You will find web services that use PHP + some output format other than HTML, like XML or JSON, but those are designed strictly to be read by other computer programs, not by humans. Example of html <-- this is static <font face="tahoma" size="2px" color="red">4*2=8</font> HTML: Example of PHP <--- this is dynamic and printed as html <?PHP $value1 = "4"; $value2 ="2"; $total = $value1*$value2; echo "<font face=\"tahoma\" size=\"2px\" color=\"red\">$total</font>"; ?> PHP: Both example giving same output but at php you can adjust any of the value and let it do the task without have to write it already. so it is operational language while html is static Thanks and hope it helps
Yeah that question REALLY doesn't make any sense whatsoever -- since the purpose of PHP is to output HTML... -- hence the recursive abbreviation: PHP: Hypertext Preprocessor. It's made to pre-process hypertext -- the primary hypertext in question BEING HTML -- HyperText Markup Language. Though that's why it's a laugh when you come across people who call themselves PHP "experts", but then don't know enough HTML to be using PHP for a blasted thing in the first place.
PHP means Hypertext Preprocessor and HTML means Hypertext Markup Language. PHP is an HTML-embedded scripting language. and It is use to create portal's like Ebay,homeshop18 etc. while HTML is used to create simple website.
We all know the basic differences between html & php is, Html is a language used for creating static pages whereas php- a language is used for creating dynamic web pages. html is an abbreviation for HyperText Markup Language where as PHP stands for Hypertext PreProcessor or Personal Home Page. html is a client side language where as php is a serverside programming language. Still there is a lot to know. you may search online for more.
Imagine that you can modify your house. You can change the color of the wall, the style of the doors, the height of the roof, etc. And imagine you can change it saying magical words like "Change the color of the wall to orange only when it's friday and it's raining outside". The physical elements: wall, door, roof, color, etc are the same as HTML. The magical words are PHP. With PHP you can change, create or remove the HTML using a special language. Hope it helps.
Both of them are completely different languages. php is a server side programming language whereas HTML is a simple markup language used for basic structure of a website, php can control all the server functionalities and much more.
HTML is the best choice to create static website while PHP is mainly used to create dynamic website, PHP can be combined with database which make you manage and update your website easily and effectively, this is good if your website has a great number of contents or pages. However, in my personal opinions, I'd prefer HTML to create my own website because HTML is well recognized by search engines like Google. If you run a small online business, I think you should choose HTML.
Since PHP OUTPUTS HTML, how the **** does it make ANY difference in terms of SEO? The answer is, it doesn't... So like MOST of the responses and even the OP's question, your post doesn't make any sense. To be brutally frank, people are dumber for having read around half the responses in this thread.
No, I would NEVER use that comparison because the job of HTML is NEVER to say what it looks like. That's CSS' job! PHP is for gluing together data (like from a database) to the markup (HTML) -- the HTML should say what things are, CSS is then for what things look like for each of your media targetS. (Yes, PLURAL!) Unless of course you have your head wedged up 1997's arse.
absolutely right, there is no comparison between PHP and HTML. though it can be PHP vs .Net but can't be HTML vs PHP. HTML is to make your website active and PHP is the make those active sections functional (forms, and other call to actions)
HTML is something you need to know if you're programming websites PHP, PERL, java, ASP, .net, etc are programming languages you will use with HTML to build a website with functionality.
I think of PHP and HTML as being very similar with subtle differences, as the base of PHP IS HTML obviously, but it is the lesser known facts that tend to break it down better. For example with SEO Alot of webmasters think that html pages are ranked well than PHP extension . First of all thats not true, it depends on how you use php . As pulse added the problem is related to the fact that PHP uses in some cases session ids in the url and since session changes from user to user the URL looks different at the “eyes” of a search engine. PHP pages are dynamic so you will find in most cases question marks in the url Google doesnt seem to pay lots of attention to this since it means dynamic conent, maybe automatic information and marks that as not so relevant information. Poeple use dynamic page sto fool search engines and Google pays attention to that also.
While I'm left wondering where the **** people come up with that idiotic nonsense. PHP is a programming language that is TYPICALLY used to output HTML, the language itself is based on C, not HTML. There is nothing "Similar" about them as they are two separate entities with little if anything in common! Subtle differences?!? They are light years APART. Seriously, after some three decades of programming when I see statements like that I really wonder just what the blue blazes is in the kool-aid. People are dumber for having read posts like that. Of course, that the rest of it with the talk of the URL's reeks of SEO-Tard scam artists nonsense...
I would say so. In fact php and html are totally unrelated. PHP is a true programming language, not a markup language. It manipulates data, usually as variables, through functions and methods (to use the Pascal terms). It gets its data from the server as name/value pairs, or from a database flat file or an rdbms through an api. PHP doesn't care where or what it gets as long as it meets requirements of its own api. It then either prints the results in whatever form the programmer codes in, say html or xml or gobbledy-gook, or it exports hash lists or arrays to, say, a templating engine where it is formatted for the UA, again in whatever form is needed. HTML need never be in the mix at all. cheers, gary
Correct, while PHP was created to pre-process HTML, it doesn't have to have ANY HTML inside it. People use it to output XML -- they use it to output CSS (stupid, but people do it) -- you can even use the GD module to make it output Syntactically it has NOTHING to do with XML, SGML or HTML, it is a C syntax language. Just because you can echo out HTML or have HTML outside the crappy PHP tags of <?php ?>, and it was created to glue HTML bits together with data from other sources, does not mean it has jack **** to do with HTML so far as the language's format, structure and function is concerned. Seriously, you think THIS is 'similar' to HTML?!? On what planet? <?php // Set the content-type header('Content-Type: image/png'); // Create the image $im = imagecreatetruecolor(400, 30); // Create some colors $white = imagecolorallocate($im, 255, 255, 255); $grey = imagecolorallocate($im, 128, 128, 128); $black = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, 399, 29, $white); // The text to draw $text = 'Testing...'; // Replace path by your own font path $font = 'arial.ttf'; // Add some shadow to the text imagettftext($im, 20, 0, 11, 21, $grey, $font, $text); // Add the text imagettftext($im, 20, 0, 10, 20, $black, $font, $text); // Using imagepng() results in clearer text compared with imagejpeg() imagepng($im); imagedestroy($im); ?> Code (markup): HTML doesn't have functions, variables, control structures or logic flow. It is a markup language, PHP is a programming language. Realistically apart from the fact PHP can output HTML, they are nothing alike and have little if anything in common. Though again, if you're one of those re-re's who puts <?php ?> on every blasted line of your code for no good reason other than code bloat and coder ineptitude, you might not see that... but again that's why I'd like to see <?php and ?> stricken from the PHP language entirely, they just encourage half-assed sloppy coding and prevents certain developers from ever grasping the point of having a programming language under their website in the first place. Basically, you might have HTML in your PHP code in the same file -- that doesn't make that HTML be PHP... it's still just HTML being output AS HTML, it's just in your PHP.