-2

Consider the following code:

<?php
$username = $_POST['username'];
echo 'How can I display a variable  inside some html code using the echo in php?';
?>
android
  • 29
  • 3

2 Answers2

0

You can write php code inside html by using php tags like

<p class='test'><?php echo "test php" ?></p>
Maha Dev
  • 3,915
  • 2
  • 31
  • 50
0
    <?php
$username = $_POST['username'];
echo 'How can I display a variable '.$username.' inside some html code using the echo in php?';
?>
<i><?php echo $username; ?></i>
Hussy Borad
  • 626
  • 5
  • 20