2. How much PHP Tags / Syntax? Echo and print?

<SCRIPT LANGUAGE='PHP'> </SCRIPT>

<% %> [enabled asp_tags php.ini setting]

<?php ?> [This is standard Tags]

<? ?> [enabled short_open_tag php.ini setting]

Echo and print: In PHP there are two basic ways to get output: echo and print. echo and print are more or less the same. They are both used to output data to the screen. echo and print is not actually a function (it is a language construct), echo can take multiple parameters (although such usage is rare) while print can take one argument. echo is marginally faster than print.

<?php
	echo "This ", "string ", "was ", "made ", "with multiple parameters.";
?>  
<?php
	print "I'm about to learn PHP!";
?>  
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s