Home php教程 php手册 php 学习笔记第1/2页

php 学习笔记第1/2页

Jun 13, 2016 pm 12:19 PM
php processor study yes Overview notes pre

PHP概述:
php是Hypertext Preprocessor(超文本预处理器)的缩写,是一种服务器端、跨平台、HTML嵌入式的脚本语言,其独特的语法混合了C语言、Java语言和Perl语言的特点,是一种被广泛应用的开源式的多用途脚本语言,
尤其适合web开发。php是b/s体系结构,属于三层结构。服务启动后,用户不用相应客户端软件,只用浏览器浏览即可以,即保存了图形化的用户界面,又大大减少了应用维护量。php是起源于自由软件,即开源软件,
使用php进行web应用程序的开发具有安全性高、跨平台特性、支持广泛的数据库、易学性、执行速度快、成本低、模板化、支持面向对象、内嵌Zend加速引擎,性能稳定快速等优势。在Tiobe世界编程排行榜上排名第
三,市场占有率为9.977%。
PHP扩展库:
从php5开始,新增了内置的标准扩展库:XML扩展库-DOM,SimpleXML、SPL、SQLite、而像MySql、MySqlI、Overload、GD2等这些库则被放在PECL外部扩展库中,需要时在php.ini配置文件中先择加载。php搜索扩展库
的默认位置在PHP5中是C:\php5。要修改此项以符合用户自己的php设置,需要编辑php.ini文件:需要修改extension_dir设置以指向用户放置扩展库的目录或者说放置php_*.dll文件的位置。例如:extension_dir=C
:\php\extensions;要在php.ini中启用某项扩展库,需要去掉该行extension=php_*.dll前缀的注释符号,将想要加载扩展库前的分号(;)删除即可,例如,启用Bzip2扩展库。将下面代码;extension=php_bz2.dll改
成extension=php_bz2.dll;
前期准备工作:
1.HTML(Hypertext Markup Language,超文本标记语言)web发展基石
2.Javascript,客户端脚本语言,也可以编写在服务器端执行的脚本程序。
网站建设基本流程:
确定网站主题(主要内容:大全精深)-->搜集材料-->规划网站(结构、版面布局、颜色搭配、风格等)-->选择开发工具-->制作网页(先大后小【结构】,先简单后复杂)-->测试网站-->上传网站-->推广宣传-->维
护更新-->确定网站主题。
php学习资源:
开发工具下载网站:http://www.jb51.net
php用户手册官方网站:http://www.php.net
常用网站资源:
phpchina开源社区:http://www.phpchina.com

如何学好PHP:
1.明确自己的学习目标和大的方向。
2.学会配置php的开发环境
3.扎实基础了解编程知识,掌握常用的函数。
4.了解设计模式。
5.多实践、多思考、多请教。
6.学技术最忌讳急躁,遇到技术问题,必须冷静对待。
7.php函数几千种,下载一个php中文手册和MySql手册。
8.多看视屏录像,领悟他人的编程思想。
9.养成良好的编程习惯。
10.遇到问题不要放弃,要有坚持不懈、持之以恒的精神。

php配置有点复杂了,昨天晚上配置了半天还没有成功!不得不寻求更简单的解决方法:WampServer 5 集成环境

Wamp5是Apache+PHP+Mysql 在Windows下的集成环境,拥有简单的图形和
菜单安装。该版本集成了PHP5.2.5 Mysql5 Apache2 phpMyAdmin 2.11.2.1
SQLiteManager 1.2.0 满了大部分PHPer的需求.

从语法上看,PHP语言近似于C语言。可以说,PHP是借鉴C语言的语法特征,由C语言改
进而来的。我们可以混合编写PHP代码和HTML代码,不仅可以将PHP脚本嵌入到 HTML
文件中,我们甚至还可以把 HTML 标签也嵌入在 PHP 脚本里。以下是你可以采用的几种方法。
你可以选用其中一种你最适合的并且就这样坚持这种方法!
从HTML中分离
以下是可以使用的方法:

. . . ?>







与Perl和C一样,在PHP中用“;”来分隔语句。那些从HTML中分离出来的标志也表示语句的结束。
注释
PHP支持C,C 和Unix风格的注释方式:
/* C,C 风格多行注释 */

// C 风格单行注释

# Unix风格单行注释

如何处理简单的PHP错误:

1、你要把PHP.ini 里的 display_errors = On 才可以显示错误位置

2、习惯使用echo 或者 print 打印

3、学会使用注释来屏蔽符号来调试
// ……….
/*………… */
#..............

4、要懂得看错误信息(英文不熟悉阿拉伯数字总认识吧)

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1253
24
PHP and Python: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP: A Key Language for Web Development PHP: A Key Language for Web Development Apr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP in Action: Real-World Examples and Applications PHP in Action: Real-World Examples and Applications Apr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

The Enduring Relevance of PHP: Is It Still Alive? The Enduring Relevance of PHP: Is It Still Alive? Apr 14, 2025 am 12:12 AM

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP and Python: Code Examples and Comparison PHP and Python: Code Examples and Comparison Apr 15, 2025 am 12:07 AM

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

PHP vs. Other Languages: A Comparison PHP vs. Other Languages: A Comparison Apr 13, 2025 am 12:19 AM

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP and Python: Different Paradigms Explained PHP and Python: Different Paradigms Explained Apr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP's Purpose: Building Dynamic Websites PHP's Purpose: Building Dynamic Websites Apr 15, 2025 am 12:18 AM

PHP is used to build dynamic websites, and its core functions include: 1. Generate dynamic content and generate web pages in real time by connecting with the database; 2. Process user interaction and form submissions, verify inputs and respond to operations; 3. Manage sessions and user authentication to provide a personalized experience; 4. Optimize performance and follow best practices to improve website efficiency and security.

See all articles