echo variable in php code example Example 1: echo php <?php $string = "Hello, World!"; echo $string; ?> Example 2: print in php print_r("");