Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



How To Use Echo statement in PHP

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 18-03-2009
Member
 
Join Date: Feb 2009
Posts: 72
How To Use Echo statement in PHP
  

Hello,

please some one help. I want to pass the variables neatly in the below coloured boxes... how do I execute such using echo function.This is I am asking for to see how exactly we could use Echo statement in the PHP...

Reply With Quote
  #2  
Old 18-03-2009
Member
 
Join Date: Dec 2008
Posts: 183
Re: How To Use Echo statement in PHP

The echo () function is used to output the given argument. It can output all types of data and multiple outputs can be made with only one echo () command.

Examples:

PHP Code:
<?php
    
Echo "Hello";
    
//Outputs a string
    
Echo $variable;
    
//Outputs a variable
    
Echo "Multiple things " $on " one line";
    
//Outputs a string, then a variable, then a string. All are separate ?>
Reply With Quote
  #3  
Old 18-03-2009
Member
 
Join Date: Oct 2008
Posts: 167
Re: How To Use Echo statement in PHP

echo() is not actually a function (it is a language construct), so you are not required to use parentheses with it. echo() (unlike some other language constructs) does not behave like a function, so it cannot always be used in the context of a function. Additionally, if you want to pass more than one parameter to echo(), the parameters must not be enclosed within parentheses.

echo() also has a shortcut syntax, where you can immediately follow the opening tag with an equals sign. This short syntax only works with the short_open_tag configuration setting enabled.

PHP Code:
<?php
echo "Hello World";

echo 
"This spans
multiple lines. The newlines will be
output as well"
;

echo 
"This spans\nmultiple lines. The newlines will be\noutput as well.";

echo 
"Escaping characters is done \"Like this\".";
?>
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How To Use Echo statement in PHP"
Thread Thread Starter Forum Replies Last Post
Need to know about Kyocera Echo Corwinn Portable Devices 4 15-02-2011 05:35 PM
What is Echo? What is the difference between Echo and Print statement in PHP? Preetish Software Development 3 05-09-2009 02:41 PM
Information on php echo Rebeccak Software Development 3 07-07-2009 10:56 AM
What is the difference between while statement & do statement? Athos Software Development 4 25-02-2009 08:52 PM
Set colors in echo revolucioncg Software Development 3 14-02-2009 09:53 PM


All times are GMT +5.5. The time now is 08:09 PM.