Home php教程 php手册 PHP函数学习心得

PHP函数学习心得

Jun 13, 2016 am 10:25 AM
php one time What function land study Experience Browse of part

最近我较细致地浏览了一下PHP的函数部分,以前没有看的时候,没有什么感觉,可是现在我才发现要想真正的了解PHP的全部功能的话,恐怕绝不是一日之寒啊!虽然PHP所提供的函数并不是最丰富的,但数量也很相当,功能也十分强大,而且涉及的范围很是广泛,要想真正掌握的话,除了PHP自身的知识以外,还需要许多相关的网络知识等。但如果你真的有耐心一个一个的攻克每个函数的话,我相信,你一定会受益非浅的。
好了,下面是我在学习过程中的一点体会和学习总结,拿出来和大家一起讨论一下,不知是否对大家的学习能有所帮助!
目前,以PHP4为准,最新的在线手册中一共包括76大类函数库,每大类中又有不同数量的具体函数,数量不等。这么多的函数,我一上来的时候,都看蒙了,许多函数都不懂啊!慢慢的,为了学习的方便,我将这些函数分成了以下几个大类:
1、PHP常用函数:这类函数基本上应该是你在缺省安装完PHP后就具备的,你马上就可以使用,包括数学函数、字符串函数等,其他许多语言中都有类似的函数,有过一些编程经验的人,学起来应该不是很难。
2、与数据库管理系统交互的函数:看过PHP手册的前言部分的人都应该知道,PHP支持大量的数据库系统,PHP与这些数据库系统的交互都是通过一批函数来完成的。虽然PHP支持的数据库很多,但通过PHP操作数据库的方式基本上是一样的,编程的思路也大同小异。所以大家可以根据自己的情况选择其中的一种学习,学会一个之后,其他的函数库也就基本上掌握了,当然可能还有些细微的不同,但我想有了第一种数据库的经验,其他的对于你来说应该是没有什么问题的了。
3、扩展或非常用的函数:这类函数又分为两类:一种是在编译PHP时需要带上相关的编译选项时才可以支持的。另一种是为支持一些其他公司的产品而设计的,所以如果你想使用的话,还需要相关的产品的支持和知识。
通过以上的分类,我认为我们在学习的时候应该按照上面的分类顺序来进行,先掌握所有的基本的操作函数,他们可能还会在你今后的学习中会用的,这部分应该不是很困难的,而且学习之后会给你继续向下学习的信心啊!然后再去学习数据库函数库,动态网页的实现很大的程度取决于数据库系统的应用,如果不会用PHP来控制数据库的话,那我只能说你还没有学会PHP。那么这么多的函数应该如何去做呢?选择其中的一种,由于MySQL和PHP的绝对组合,我觉得你还是以它为起点吧,并且你可以在windows环境下去学习的,工作学习两不误,何乐而不为呢?最后再去学习第三类函数,当然可能你不用去学它们的,因为这些一般都在解决比较特殊的问题时,才需要使用的。如果你想学的话,当然没有人会阻止你,不过在学习这部分函数的时候,恐怕你还需要许多其他的相关知识,例如:Linux、XML等等。只有在这种情况下,你才能真正了解你在做什么,应该如何去调试你的程序,和分析你的程序是否执行正确呢。


最后还有一点是非常重要的:那就是在学习函数的时候,最好是自己动手编些小程序,验证一下函数的功能,这样你可以记得较深刻的。学习的效果应该较好的。
好了,以上是我在学习的过程中的一点体会,下面是我在学习的过程中认为应该是属于第一类的函数,数据库函数大家一看就知道,不用我说的,其他的应该就是属于第三类的了!仅供大家参考,还请大家多多指教啊!
第一类PHP常用函数:
array、Date/Time、Directory、Error and Logging、FileSystem、FTP、HTTP、Mail、Math、Network、PHP Option、Regexps、Session、String、URL、Variable
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 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
1664
14
PHP Tutorial
1266
29
C# Tutorial
1239
24
Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

PHP Program to Count Vowels in a String PHP Program to Count Vowels in a String Feb 07, 2025 pm 12:12 PM

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? Apr 03, 2025 am 12:03 AM

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

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 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.

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

Explain the match expression (PHP 8 ) and how it differs from switch. Explain the match expression (PHP 8 ) and how it differs from switch. Apr 06, 2025 am 12:03 AM

In PHP8, match expressions are a new control structure that returns different results based on the value of the expression. 1) It is similar to a switch statement, but returns a value instead of an execution statement block. 2) The match expression is strictly compared (===), which improves security. 3) It avoids possible break omissions in switch statements and enhances the simplicity and readability of the code.

See all articles