DEV Community

John Ellee Robado
John Ellee Robado

Posted on

Table Head using foreach loop in PHP

HTML


ID Number
Name
Birthday
Address
Course

PHP
<?php

$info = "ID Number, Name, Birthday, Address, Course";
$data = explode(',', $info);
foreach ($data as $row) {
echo "

".$row."";
}
?>

In PHP, the lines of code of HTML will reduce down

Top comments (0)