-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
  • 2

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,709
  • 1
  • 28
  • 49
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
  • 618
  • 5
  • 20