Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What's the difference between <?php ?> and <?= ?>

user-image
Question added by Adel Ezat Fawzy Ellozy , Webdeveloper. , Saudi Arabian Maritiem Sports Federation
Date Posted: 2017/01/27
Adel Ezat Fawzy Ellozy
by Adel Ezat Fawzy Ellozy , Webdeveloper. , Saudi Arabian Maritiem Sports Federation

<?php  ?> is a regular php opening and closing tag

<?=  ?> is a short hand for <?php  echo  '' ;  ?> 

Ehab  Shaker
by Ehab Shaker , Dot Net Developer , Info Strategic

<?php

$s="hello world";

?>

<span ><?= $s ?></span>

<br>

 

<?php

$s="hello world";

?>

<span ><?php echo $s ?></span>

_________________________________________________

The Results is:

     hello world 

     hello world

___________________________________________

If this is what you mean....

Zuhair Muhammed
by Zuhair Muhammed , Software / Web Developer , CIEL HR Services Pvt. Ltd.

<?php

// Mostly used way and Correct way of coding

?>

<?

// To use this tags we have to make change in php.ini file. we need to enable short_open_tag

?>

Zaighum Abbas
by Zaighum Abbas , WEB DEVELOPER , MARTECH CCTV & IT SERVICES SHARJAH

both are tabs and used for php code no difference in both statements.

 

More Questions Like This