Type the following lines and save them as a.php
<html>
<body>
<?
echo "hello world";
?>
</body>
</html>
Type the following lines and save them as a.php
<html>
<body>
<?
echo "hello world";
?>
</body>
</html>
Yes, well done. Although that will only work if you have short tags enabled other wise you have to use <?php ?>
If you are using only <? for open PHP code you need to have enabled short open tag in your PHP config file.
Yes. In general you should avoid using short tags, including the short form of 'echo' (<?=).
@ ag
Can I ask why you posted this article?
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.