For output a text, variables, html tags and etc. is used function PHP echo
PHP echo function will output the text inside it.
Example 1: output variable
| <?php $country = "Canada"; echo $country; ?> |
| Canada |
Example 2: output text
| <?php echo "Country"; ?> |
| Country |
Example 3: output text with variable
| <?php $my_name = "Valeri"; $my_country = "Georgia"; echo "My name is" . $my_name . " and I am from " . $my_country; ?> |
| My name is Valeri and I am from Georgia |
Example 4: output text with variables and with html tags
| <?php $my_name = "Valeri"; $my_country = "Georgia"; echo "My name is <b>" . $my_name . "</b><br> and <br>I am from <b>" . $my_country . "</b>"; ?> |
| My name is Valeri and I am from Georgia |