Question : how to use php to print inside html
Answered by : ibrahim-sanna
<?php
$array = array(1, 2, 3, 4);
?>
<table>
<thead><tr><th>Number</th></tr></thead>
<tbody>
<?php foreach ($array as $num) : ?>
<tr><td><?= htmlspecialchars($num) ?></td></tr>
<?php endforeach ?>
</tbody>
</table>
Source : https://stackoverflow.com/questions/18140270/how-to-write-html-code-inside-php-i-want-write-html-code-within-the-php-sc | Last Update : Wed, 08 Jun 22
Question : php print html code
Answered by : khayrul-islam-shanto
<?php $name = "GeeksforGeeks"; echo "<h1>Hello User, </h1> <p>Welcome to {$name}</p>";
?>
Source : | Last Update : Thu, 30 Jun 22