
<?php
function getTable() {
$table = array(
array("ID", "Name", "Email"),
array("1", "xiaomi", "xiaomi@example.com"),
array("2", "xiaohua", "xiaohua@example.com"),
array("3", "lili", "lili@example.com")
);
return $table;
}
$tableData = getTable();
echo '<table border="1">';
foreach($tableData as $row) {
echo '<tr>';
foreach($row as $cell) {
echo '<td>' . $cell . '</td>';
}
echo '</tr>';
}
echo '</table>';
?>
标签: php字符串, php数组, php生成html表格
上面是“php如何返回的字符串数组并生成html表格”的全面内容,想了解更多关于 php入门 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_4206.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

Vue项目开发中报“TypeError: Cannot read property 'yyy' of null”错误怎么解决?