Output value of a string variable ($str) to the output, including HTML tags in PHP

Description

The following code shows how to output value of a string variable ($str) to the output, including HTML tags.

Example


//ww w. ja  v  a 2 s  .  c o  m
<?php
   $str = "Hello world!";
   print $str;
   print "<br>What a nice day!";
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Development »




Environment
Error
Hash
Include
Locale
Math
Network
Output
Reflection
PHP Regular Expressions