What is the difference between php and html file extensions? -


i having .php file following code. while changing extension of file .html behaving in same way. can explain following:

  1. why file behaving in same manner both extensions?
  2. what difference between .php , .html file extensions?

.php file

<html>       <head>           <!-- html code -->      </head>       <body>           <?php echo "hello!" ?>      </body>  </html> 

the filetype way identify file, can't trust them.

depending on web server configuration, see different results.

.html use html no serverside code.

.php used serverside php code , html if required.

they can used anything, depends on setup.


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -