-4

im tried to write php to my html file, im using wampserver, but when i add php in html it's turns to comment why ? Pls help.

<?php 
echo "hello"

 ?>

turns to comment

<--?php 
echo "hello"

 ?-->
Trke Rap
  • 63
  • 1
  • 1
  • 6

1 Answers1

1

You don't add PHP code to an HTML file.

If the file has PHP code then the file needs to have a valid PHP extension, such as .php for example. The PHP file can contain HTML code also.

Tim Penner
  • 3,551
  • 21
  • 36