Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

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

user-image
Question ajoutée par Adel Ezat Fawzy Ellozy , Webdeveloper. , Saudi Arabian Maritiem Sports Federation
Date de publication: 2017/01/27
Adel Ezat Fawzy Ellozy
par 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
par 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
par 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
par 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

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?