云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > PHP语言基础

PHP语言基础

  • 62 次阅读
  • 3 次下载
  • 2025/12/9 6:03:21

实验二 PHP语言基础

1、 实验目的和要求

(1) 熟悉PHP语句在HTML中的嵌入位置; (2) 熟悉输出字符串的基本方法; (3) 熟悉PHP常量与预定义常量; (4) 熟悉PHP变量与相关函数; (5) 熟悉PHP常见的数据类型; (6) 掌握字符串及相关函数; (7) 熟悉PHP的运算符;

(8) 掌握PHP的流程控制语句。

2、 实验环境

(1) PC机;

(2) 操作系统:Windows;

(3) Web服务器:Apache;数据库服务器:MySQL;语言解释器:PHP; (4) 以上软件的集成安装包:XAMPP或WampServer; (5) 开发工具:PhpStorm。 3、 实验内容

(1) 验证变量的输出方式; (2) 验证数据类型的比较;

(3) 综合运用所学知识实现要求的页面。 4、 实验实现过程

(1) 观察以下程序的输出,理解变量在字符串中的输出方法:

var_dump(10==\var_dump(10.0==\var_dump(10===\ var_dump(1==TRUE); var_dump(1.5==TRUE); var_dump(\var_dump(\var_dump(\var_dump(\ (3) 综合练习:

根据大课所学的各项内容,在页面中显示如下效果:

要求:

a) 定义多个变量名带序号的变量,其值为序号。并把变量名和相应的

值显示在表格中;

b) 变量的个数由程序中的某个常量决定; c) 变量值为偶数的行,背景色为黄色。

小知识:Zen Coding

在页面中能输入HTML代码的地方输入: table>tr*5>td*2

再按 TAB 键,看能发现什么?

更多参考:https://code.google.com/p/zen-coding/

2

Zen Coding — a new way of writing HTML and CSS code

Follow us on Twitter @zen_coding

New version 0.7 is available (March 13, 2011), read release notes for more info.

Zen Coding is an editor plugin for high-speed HTML, XML, XSL (or any other structured code format) coding and editing. The core of this plugin is a powerful abbreviation engine which allows you to expand expressions—similar to CSS selectors—into HTML code. For example:

div#page>div.logo+ul#navigation>li*5>a

...can be expanded into:

Read more about current Zen Coding syntax

Abbreviation engine has a modular structure which allows you to expand abbreviations into different languages. Zen Coding currently supports CSS, HTML, XML/XSL and HAML languages via filters.

Current features of abbreviation engine

? ? ? ?

ID and CLASS attributes: div#page.section.main.

Custom attributes: div[title], a[title=\, td[colspan=2]. Element multiplication: li*5 will output

  • tag five times.

    Item numbering with $ character: li.item$*3 will output

  • tag three times, replacing $ character with item number.

    3

    ? ?

    Multiple '$' characters in a row are used as zero padding, i.e.: li.item$$$ → li.item001 Abbreviation groups with unlimited

    nesting: div#page>(div#header>ul#nav>li*4>a)+(div#page>(h1>span)+p*2)+d

    iv#footer. You can literally write a full document markup with just a single line.

    ? ? ?

    Filters support

    div tag name can be omitted when writing element starting from ID or

    CLASS: #content>.section is the same asdiv#content>div.section. (v0.7) Text support: p>{Click }+a{here}+{ to continue}.

    To better understand how Zen Coding works, watch demo video and read Smashing Magazine tutorial. Zen Coding isn’t only a decent abbreviation engine, it also provides some very useful actions for HTML-coder’s every day needs, like: Wrap with Abbreviation, Tag Balancing, Toggle Comment, Remove Tag etc. Read more about available actions.

    4

    搜索更多关于: PHP语言基础 的文档
    • 收藏
    • 违规举报
    • 版权认领
    下载文档10.00 元 加入VIP免费下载
    推荐下载
    本文作者:...

    共分享92篇相关文档

    文档简介:

    实验二 PHP语言基础 1、 实验目的和要求 (1) 熟悉PHP语句在HTML中的嵌入位置; (2) 熟悉输出字符串的基本方法; (3) 熟悉PHP常量与预定义常量; (4) 熟悉PHP变量与相关函数; (5) 熟悉PHP常见的数据类型; (6) 掌握字符串及相关函数; (7) 熟悉PHP的运算符; (8) 掌握PHP的流程控制语句。 2、 实验环境 (1) PC机; (2) 操作系统:Windows; (3) Web服务器:Apache;数据库服务器:MySQL;语言解释器:PHP; (4) 以上软件的集成安装包:XAMPP或WampServer; (5) 开发工具:PhpStorm。 3、 实验内容 (1) 验证变量的输出方式; (2) 验证数据类型的比较; <

    × 游客快捷下载通道(下载后可以自由复制和排版)
    单篇付费下载
    限时特价:10 元/份 原价:20元
    VIP包月下载
    特价:29 元/月 原价:99元
    低至 0.3 元/份 每月下载150
    全站内容免费自由复制
    VIP包月下载
    特价:29 元/月 原价:99元
    低至 0.3 元/份 每月下载150
    全站内容免费自由复制
    注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
    微信:fanwen365 QQ:370150219
    Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com