Support Forums

Full Version: Noob's doubt on echo function in php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have just started to learn some php via internet,
I just went through the very basics of php,
I studied some echo functions inside the php,while i tried to practice them
I got strucked,this is the code i tried

Code:
<?=php
echo "why is this","echo script","not working!!";
?>

and i got this error

Code:
Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in C:\xampp\xamp\echo11.php on line 2


I am just a noob to php,so just bear with me ,

and try to help me to solve this error....
<?php
echo = "why is this echo script not working!!";
?>

You added a =
Code:
<?php
echo = "why is this echo script not working!!";
?>

You added a =

Thanks bro,issues has been fixed,Thank you once again for your kindly help...
Well, that would work kind of.

PHP Code:
<?="why is this echo script not working!!"?>

Small print hack using shorttags.
You're full of answers, Orgy. How can "=" be used in substitute of <?php though?
(12-06-2010, 01:30 AM).Shannon Wrote: [ -> ]You're full of answers, Orgy. How can "=" be used in substitute of <?php though?

It's not. <? is a legal (yet frowned upon) short tag, that works perfectly instead of <?php as long as you have short tags enabled in your php.ini

The = takes place of a print