/**************by garcon1986*******************/
PEAR
(PHP Extension and Application
Repository)PHP扩展与应用程序库。
PEAR是“一个可重用PHP组件的框架和发布系统”。PEAR可以下载、安装、升级及删除PHP脚本。
使用PEAR包的时候,不必为了脚本的位置或者怎么找到它们而担心,扩展命令行接口(CLI)也很容易使用。
PEAR是一个由社区推动的PHP项目,官方发布的PHP中就包含了PEAR。
PECL
(PHP
扩展库)的全称是 The PHP Extension Community Library ,是一个开放的并通过PEAR打包格式来打包安装的PHP 扩展库仓库。通过PEAR 的Package Manager可以对 PECL 模块进行下载和安装。
PEAR和PECL的区别:
Pear:是PHP的扩展代码包,所有的扩展均以PHP代码的形式出现,功能强大,安装简单,甚至可以改改就用。使用的时候,要在代码中进行Include才能够使用。
Pecl:是PHP的标准扩展,可以补充实际开发中所需的功能,所有的扩展都需要安装,在Windows下面以Dll的形式出现,在linux下面,需要单独进行编译,它的表现形式为根据PHP官方的标准用C语言写成,尽管源码开放但是一般人无法随意更改源码。
最直接的表述:Pear是PHP的上层扩展,Pecl是PHP的底层扩展。
这两种方法其实都是为特定的应用提供现成的函数或者类,本质上来说都是一样的。
正则表达式
:
PCRE
:PERL兼容正则表达式函数(perl compatible regular expression)
函数:
- preg_filter
— Perform a regular expression search and replace - preg_grep
— Return array entries that match the pattern - preg_last_error
— Returns the error code of the last PCRE regex execution - preg_match_all
— Perform a global regular expression match - preg_match
— Perform a regular expression match - preg_quote
— Quote regular expression characters - preg_replace_callback
— Perform a regular expression search and replace using a callback - preg_replace
— Perform a regular expression search and replace - preg_split
— Split string by a regular expression
POSIX
:
函数:
- posix_access
— Determine accessibility of a file - posix_ctermid
— Get path name of controlling terminal - posix_errno
— Alias of posix_get_last_error - posix_get_last_error
— Retrieve the error number set by the last posix function that failed - posix_getcwd
— Pathname of current directory - posix_getegid
— Return the effective group ID of the current process - posix_geteuid
— Return the effective user ID of the current process - posix_getgid
— Return the real group ID of the current process - posix_getgrgid
— Return info about a group by group id - posix_getgrnam
— Return info about a group by name - posix_getgroups
— Return the group set of the current process - posix_getlogin
— Return login name - posix_getpgid
— Get process group id for job control - posix_getpgrp
— Return the current process group identifier - posix_getpid
— Return the current process identifier - posix_getppid
— Return the parent process identifier - posix_getpwnam
— Return info about a user by username - posix_getpwuid
— Return info about a user by user id - posix_getrlimit
— Return info about system resource limits - posix_getsid
— Get the current sid of the process - posix_getuid
— Return the real user ID of the current process - posix_initgroups
— Calculate the group access list - posix_isatty
— Determine if a file descriptor is an interactive terminal - posix_kill
— Send a signal to a process - posix_mkfifo
— Create a fifo special file (a named pipe) - posix_mknod
— Create a special or ordinary file (POSIX.1) - posix_setegid
— Set the effective GID of the current process - posix_seteuid
— Set the effective UID of the current process - posix_setgid
— Set the GID of the current process - posix_setpgid
— Set process group id for job control - posix_setsid
— Make the current process a session leader - posix_setuid
— Set the UID of the current process - posix_strerror
— Retrieve the system error message associated with the given errno - posix_times
— Get process times - posix_ttyname
— Determine terminal device name - posix_uname
— Get system name
PCRE比POSIX更强大。