Home » PHP Tutorial » PHP echo() Function Example | PHP Inbuilt Function

PHP echo() Function Example | PHP Inbuilt Function

PHP-Echo-Function

We are sharing basic PHP Echo Function Example For Beginners.

PHP echo() Function Example | PHP Inbuilt FunctionPHP echo() Function Example | PHP Inbuilt Function

PHP Echo  Example

Let’s We start define PHP Echo function example for beginners to get easily understand how to use inbuilt functions in PHP Language.

 

 

 

Lets See The PHP Echo () Function Example

<? PHP

Echo “Hello PHP Function”;

?>

Echo Function Uses

  • This function can execute one or more string.
  • Echo function is not a function, and  not use parentheses with this function.
  • Echo () Function is always faster than print () Function.
  • This Echo function always returns 0.

PHP Syntax

<? PHP

Echo “Hello PHP Echo () Function Syntax”;

?>

PHP Coding Example

Lets see our basic PHP Code

<? PHP

$ var = “THE NUMBER IS”;

$ num  = 50;

$ add  = $ var . $ num ;

Echo $ add;

?>

PHP Echo () Function Embed With HTML Tags

In this section we have used function in the html tags.Let’s See

<html>

<head>

<title>PHP Echo Function</title>

</head>

<body>

<? PHP

Echo “<p style = ‘color: #cdcdcd;’>This is paragraph</p>”

?>

</body>

</html>

PHP Echo () Function With String Example

In this section we have used the function with String. Let’s See

<? PHP

$ str = “String 1 -“;

$ str1 = “Welcome Str”;

$ addtostring = $ str . $ str1;

Echo $ addtostring;

?>

PHP Echo With array Example

In this section we have used echo function with array.Let’s See

<? PHP

$ARR = array(“name ” => “Alies”);

Echo “This is a array  – “.$ARR[‘name’];

?>

PHP Functions With Multiple Parameter

In this section we have used function with multiple parameter.Let’s See

<? PHP
Echo ’50 ‘,’51 ‘,’52 ‘,’53 ‘,’54 parameters.’;
?>

PHP SHORTCUT SYNTAX

<? PHP
$var = “text”;
?>

<p>This is a simple  <? =$var?> for paragraph</p>

Learn PHP Code Example

<? PHP

$ var = 10;

$ var1 = 20.$ var;

if(empty($var))

{

Echo “No Value has…”;

}

Else

{

$c = $var.$var1;

Echo $c;

}

?>

PHP Echo Example

// You can also use arrays
$text = array(“val” => “text”);

Echo “this is {$text[‘val’]} !”; // this is text !

Echo ‘text is $text’; // text is $text

Let’s Start to Connect With Us Social Media Platform

Facebook :  Click Here

Twitter . :    Click Here

 

PHP Echo briefly describe

Here We are sharing basic PHP Echo () inbuilt Function for our user that they can easily understand the PHP Code and as well as get free to learn the Programming Code.This function we used for PHP to print multiple argument. So it is very easy to use in PHP.Echo () Function always return 0.

Example

<? PHP

ECHO “THIS IS NOT A FUNCTION”;

?>

WATCH OUR FREE LIVE STREMING PHP TUTORIAL

 

 

, , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*