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...
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...
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 ?>
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\".";
?>
Bookmarks