Hi all,
I just went thru a snippet and i found this tag or syntax written in php, can any body help
<?=$host;?>
I wanna know whats this;
Moderator: General Moderators
Re: I wanna know whats this;
hi there.
as to what i have understand about php
<?=$host?>
the <? is the beginning tag of every php script, It tells the server that there is something that the server needs to process. Mostly you'll find this <?php... While ?> is the end tag of <?
the = sign is for equality. and the $host is a variable. Variables are written with a $ sign at the beginning.
Where did you find this script?
as to what i have understand about php
<?=$host?>
the <? is the beginning tag of every php script, It tells the server that there is something that the server needs to process. Mostly you'll find this <?php... While ?> is the end tag of <?
the = sign is for equality. and the $host is a variable. Variables are written with a $ sign at the beginning.
Where did you find this script?
Re: I wanna know whats this;
My understanding is that that code is shorthand for ...
This expanded form is a far better practice as far as I'm concerned ... if for no other reason than because of the issue you pointed out. It's just more readable / understandable.
Code: Select all
<?php echo $host; ?>