本书集合了PHP工作原理?程序语法?编程技术及综合应用开发等方面知识,是一本适合教学?培训与自学的综合参考书.其中第1章“PHP概述”讲述PHP入门知识和Web工作原理.第2~6章内容包含PHP基本语法.第7章为PHP面向对象编程方法.第8?9章介绍PHP数据库操作.第10章说明PHP与JavaScript脚本语言的融合使用.第11章“表单交互”介绍用户通过页面提交信息给服务器端程序处理的方法.在第12章中通过AJAX技术实现客户端和服务器端的数据交互,用jQuery函数改善用户体验与编程模式.第13章“会话管理”介绍cookie和session两种基本会话方式.第14章阐述常用的网络协议与通信方式.第15章介绍3种PHP编程框架.作为总结,第16章给出3个常用网站开发流程.
样章试读
目录
- 第1章PHP概述............................................................1
1.1PHP入门..............................................................1
1.2XAMPP集成环境......................................................3
1.3HeloWorld!........................................................11
1.4网上资源..............................................................18
1.5要领领悟..............................................................21
第2章基本语法............................................................22
2.1数据类型..............................................................22
2.2变量与常量............................................................27
2.3运算符................................................................30
2.4程序控制结构..........................................................35
2.5流程控制语句..........................................................36
2.6要领领悟..............................................................43
第3章函数................................................................44
3.1定义与调用............................................................44
3.2返回值................................................................45
3.3参数..................................................................47
3.4作用域................................................................49
3.5PHP内置函数........................................................50
3.6变量函数..............................................................63
3.7要领领悟..............................................................64
第4章数组................................................................66
4.1创建..................................................................66
4.2操作..................................................................69
4.3数组函数..............................................................74
4.4典型应用..............................................................79
4.5要领领悟..............................................................84
第5章字符串..............................................................85
5.1定义..................................................................85
5.2截取与拼接............................................................87
5.3转义与还原............................................................89
5.4显示与格式化..........................................................89
5.5长度与数目............................................................93
5.6检索..................................................................95
5.7替换..................................................................96
5.8切分与合并............................................................97
5.9比较..................................................................99
5.10字符串与HTML转换................................................100
5.11要领领悟............................................................102
第6章正则表达式..........................................................104
6.1简介................................................................104
6.2基础................................................................105
6.3模式匹配............................................................107
6.4POSIX风格..........................................................108
6.5Perl风格............................................................111
6.6要领领悟............................................................115
第7章面向对象............................................................116
7.1类及其声明..........................................................116
7.2对象及其实例化......................................................118
7.3封装性..............................................................121
7.4继承性..............................................................123
7.5多态性..............................................................124
7.6常用关键字..........................................................128
7.7魔术方法............................................................132
7.8要领领悟............................................................134
第8章MySQL数据库......................................................136
8.1MySQL基础..........................................................136
8.2服务器..............................................................138
8.3数据库..............................................................143
8.4数据表..............................................................143
8.5数据................................................................146
8.6函数方法............................................................150
8.7MySQLi扩展........................................................153
8.8要领领悟............................................................156
第9章持久层类库..........................................................158
9.1PDO................................................................158
9.2ADODB............................................................165
9.3设计1:用户数据库....................................................170
9.4要领领悟............................................................174
第10章JavaScript脚本语言................................................175
10.1简介................................................................175
10.2基础语法............................................................176
10.3页面对象............................................................182
10.4PHP与JavaScript整合................................................189
10.5设计2:“登录/注册”页面..............................................192
10.6要领领悟............................................................195
第11章表单交互..........................................................196
11.1表单................................................................196
11.2提交数据方法........................................................202
11.3元素值获取..........................................................203
11.4URL传递数据......................................................204
11.5数据验证............................................................207
11.6设计3:“登录/注册”表单..............................................211
11.7要领领悟............................................................214
第12章AJAX与jQuery技术................................................215
12.1AJAX概述..........................................................215
12.2XMLHtpRequest对象................................................219
12.3异步请求处理........................................................220
12.4jQuery概述..........................................................222
12.5jQuery/AJAX......................................................230
12.6设计4:动态网页刷新................................................233
12.7要领领悟............................................................239
第13章会话管理..........................................................240
13.1数据传递方式........................................................240
13.2cookie..............................................................241
13.3sesion............................................................247
13.4设计5:购物车......................................................254
13.5要领领悟............................................................262
第14章网络开发..........................................................263
14.1网络与协议..........................................................263
14.2DNS与服务........................................................265
14.3socket技术..........................................................268
14.4FTP服务..........................................................273
14.5电子邮件............................................................276
14.6设计6:WebSocket聊天室............................................281
14.7要领领悟............................................................284
第15章框架编程..........................................................286
15.1MVC模式..........................................................286
15.2Smarty模板........................................................290
15.3ZendFramework....................................................295
15.4ThinkPHP框架......................................................298
15.5设计7:ThinkPHP框架CURD操作....................................301
15.6要领领悟............................................................308
第16章综合应用开发......................................................309
16.1Web应用开发流程....................................................309
16.2应用1:新闻发布系统................................................312
16.3应用2:网络商店....................................................322
16.4应用3:博客网站....................................................330
16.5要领领悟............................................................338