深入探索PHP与动态网站开发
1. PHP基础入门
1.1 PHP注释
在PHP中,多行注释以 /* 开始,以 */ 结束。例如:
/*
this is a comment
none of this will
be parsed by the
PHP engine
*/
PHP引擎会忽略代码注释,就像忽略HTML和JavaScript(以及任何非PHP的内容)一样,注释不会导致脚本执行出错。
1.2 PHP代码块与浏览器输出
可以使用PHP的开始和结束标签随意在HTML模式和PHP模式之间切换。下面通过一个示例展示如何根据条件输出内容。
示例1:使用 echo 输出表格
<!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:
超级会员免费看
订阅专栏 解锁全文
1906

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



