1. PHP 基础入门
1.1 PHP 注释
PHP 中的多行注释以 /* 开头,以 */ 结尾,示例如下:
/*
this is a comment
none of this will
be parsed by the
PHP engine
*/
代码注释(如 HTML、JavaScript 等非 PHP 内容)会被 PHP 引擎忽略,不会导致脚本执行错误。
1.2 PHP 代码块与浏览器输出
可以使用 PHP 开始和结束标签随意切换 HTML 模式。以下是一个简单示例,当条件为真时输出表格:
<!DOCTYPE html>
<html lang="en">
<head>
<title>More PHP Embedded Inside HTML</title>
<style type="text/css">
table, tr, th, td {
border: 1px solid #000;
border-collapse: collapse;
padding: 3px;
}
th {
font-weight: bold;
}
</style>
</head>
<body>
<?php
$some
超级会员免费看
订阅专栏 解锁全文
1万+

被折叠的 条评论
为什么被折叠?



