Click here to Skip to main content
15,889,992 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i just started to learn how to script in php

<?php   

	echo "<h1>Hello World!</h1>";

	?>


why browser display this result :

Hello World! ?>

how to remove ?> ??

What I have tried:

<pre><?php   

	echo "<h1>Hello World!</h1>";

	?>
Posted
Updated 12-Jan-17 19:45pm

1 solution

You must have made a mistake of having a double closing ?> like this:
<?php   
	echo "<h1>Hello World!</h1>";
?>
?>
Get rid of one of them.
+++++[Round 2]+++++
Another possibility is that you are running this page as a local file without a web server, right? PHP is a server-side scripting that has to be deployed on and served from a web server. You cannot run it like a normal html file.
Learn:
1. PHP 5 Installation[^]
2. Walkthrough: Setting up a Development Environment for PHP and MySQL[^]
 
Share this answer
 
v5
Comments
newbie1992 13-Jan-17 2:58am    
hi peter,
nope i don't make this mistake

this is the sample of my code :



<title>My first PHP page



<?php

echo "

Hello World!

";

?>
Peter Leow 13-Jan-17 3:02am    
Is that the only code that you have? Try this http://rextester.com/ISQSL90456.
See addition to my solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900