Support Forums
Noob's doubt on echo function in php - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: PHP The Hypertext Preprocessor (https://www.supportforums.net/forumdisplay.php?fid=21)
+---- Thread: Noob's doubt on echo function in php (/showthread.php?tid=12362)



Noob's doubt on echo function in php - mandi - 10-01-2010

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....


RE: Noob's doubt on echo function in php - DAMINKā„¢ - 10-01-2010

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

You added a =


RE: Noob's doubt on echo function in php - mandi - 10-01-2010

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...


RE: Noob's doubt on echo function in php - Orgy - 10-06-2010

Well, that would work kind of.

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

Small print hack using shorttags.


RE: Noob's doubt on echo function in php - Chimi - 12-06-2010

You're full of answers, Orgy. How can "=" be used in substitute of <?php though?


RE: Noob's doubt on echo function in php - Orgy - 12-09-2010

(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