answersLogoWhite

0


Best Answer

echo will not return output when using parenthesis because echo is not a function like print. echo is a language construct. The benefit to using echo over the print function is speed, plus you can separate data types using comma's rather than periods.

Example:

echo 'This is a string ' , $variable , ' ending string';

is the same (but faster) as:

print('This is a sting' . $variable . ' ending string');

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why php Echo not printing output with parenthesis?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How to display a variable in PHP using echo or print statements?

displaying a variable in php using echo statement? <?php $name="ram"; //declaring and defining the variable echo "$name"; //printing the variable using echo command ?>


In PHP the only way to output text is with echo.?

1


How do you output a star using PHP?

type this in a file save it as something.php and then run it <?php echo '*'; ?>


How do you get round value in php?

use the round function. For eg: <?php $value1 = 15.55; echo round($value1, 0); // Will output 16 $value2 = 20.666666666; echo round($value2, 2); // Will output 20.67 ?>


What PHP statement outputs text on the screen?

There are several different ways to output text on the screen in PHP two of the most common are echo and print. echo "Hello World!"; print ("Hello World!"); Would both print ... Hello World!


What is a regular expression in PHP?

echo or print < both of which write text: <?php echo "TEXT"; print "TEXT"; ?>


How do you put HTML in PHP?

Its done exactly the same as when you put it in an HTML file. There are 2 ways you can do it: <html> <?php // php stuff ?> </html> Or you can do it like this: <?php echo "<html>"; // php stuff echo "</html>"; ?>


How do you rectify HTML to PHP variable error?

To use HTML as variable in PHP . echo the html tag written in double quotes. Example : <?php echo "<table>"; echo "<tr><td></td><td></td></tr>" echo "</table>"; ?>


How do you write hello world in PHP?

<?php echo "Hello world"?>


When you need to obtain the ASCII value of a character which function apply in PHP?

ord() is the function you need. echo ord(' '); Would output the number 32.


Html pull down menu example for month day and year I would like to get an example on how to write month day and year in HTML form?

# <select name="month" id="month"> # <option value="1" <?PHP if($month==1) echo "selected";?>>January</option> # <option value="2" <?PHP if($month==2) echo "selected";?>>February</option> # <option value="3" <?PHP if($month==3) echo "selected";?>>March</option> # <option value="4" <?PHP if($month==4) echo "selected";?>>April</option> # <option value="5" <?PHP if($month==5) echo "selected";?>>May</option> # <option value="6" <?PHP if($month==6) echo "selected";?>>June</option> # <option value="7" <?PHP if($month==7) echo "selected";?>>July</option> # <option value="8" <?PHP if($month==8) echo "selected";?>>August</option> # <option value="9" <?PHP if($month==9) echo "selected";?>>September</option> # <option value="10" <?PHP if($month==10) echo "selected";?>>October</option> # <option value="11" <?PHP if($month==11) echo "selected";?>>November</option> # <option value="12" <?PHP if($month==12) echo "selected";?>>December</option> # </select> # # <select name="day" id="day"> # <option value="1" <?PHP if($day==1) echo "selected";?>>1</option> # <option value="2" <?PHP if($day==2) echo "selected";?>>2</option> # <option value="3" <?PHP if($day==3) echo "selected";?>>3</option> # <option value="4" <?PHP if($day==4) echo "selected";?>>4</option> # <option value="5" <?PHP if($day==5) echo "selected";?>>5</option> # <option value="6" <?PHP if($day==6) echo "selected";?>>6</option> # <option value="7" <?PHP if($day==7) echo "selected";?>>7</option> # <option value="8" <?PHP if($day==8) echo "selected";?>>8</option> # <option value="9" <?PHP if($day==9) echo "selected";?>>9</option> # <option value="10" <?PHP if($day==10) echo "selected";?>>10</option> # <option value="11" <?PHP if($day==11) echo "selected";?>>11</option> # <option value="12" <?PHP if($day==12) echo "selected";?>>12</option> # <option value="13" <?PHP if($day==13) echo "selected";?>>13</option> # <option value="14" <?PHP if($day==14) echo "selected";?>>14</option> # <option value="15" <?PHP if($day==15) echo "selected";?>>15</option> # <option value="16" <?PHP if($day==16) echo "selected";?>>16</option> # <option value="17" <?PHP if($day==17) echo "selected";?>>17</option> # <option value="18" <?PHP if($day==18) echo "selected";?>>18</option> # <option value="19" <?PHP if($day==19) echo "selected";?>>19</option> # <option value="20" <?PHP if($day==20) echo "selected";?>>20</option> # <option value="21" <?PHP if($day==21) echo "selected";?>>21</option> # <option value="22" <?PHP if($day==22) echo "selected";?>>22</option> # <option value="23" <?PHP if($day==23) echo "selected";?>>23</option> # <option value="24" <?PHP if($day==24) echo "selected";?>>24</option> # <option value="25" <?PHP if($day==25) echo "selected";?>>25</option> # <option value="26" <?PHP if($day==26) echo "selected";?>>26</option> # <option value="27" <?PHP if($day==27) echo "selected";?>>27</option> # <option value="28" <?PHP if($day==28) echo "selected";?>>28</option> # <option value="29" <?PHP if($day==29) echo "selected";?>>29</option> # <option value="30" <?PHP if($day==30) echo "selected";?>>30</option> # <option value="31" <?PHP if($day==31) echo "selected";?>>31</option> # </select> # # <select name="year" id="year"> # <?PHP for($i=date("Y"); $i<=date("Y")+2; $i++) # if($year == $i) # echo "<option value='$i' selected>$i</option>"; # else # echo "<option value='$i'>$i</option>"; # ?> # </select>


How can you embed a Java program in PHP webpage?

In the output stream (i.e. using echo), output an "embed" tag (or if using older HTML, the "applet" tag). Note that the Java will run on the client, not on the server, meaning that PHP variables, etc, will not be available to it.