php学习笔记

本文深入探讨了PHP编程中关键的错误处理机制及常用函数,包括如何使用@符号屏蔽错误信息、error_reporting()设置错误报告等级、strpos()进行字符串查找等。同时,介绍了如何利用boolfunction_exists检查函数是否存在、booldefine定义常量、realpath获取规范化路径等实用技巧。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、@ 符号: 用于屏蔽错误信息、抑制报错的(如在方法调用时),有时候你希望自己来处理错误,而不是由系统自动处理。




2、error_reporting():Sets which PHP errors are reported

3、strpos()查找字符串首次出现的位置

4、boolfunction_exists ( string $function_name ):ReturnTRUE if the given function has been defined

5、stringrealpath ( string $path ):返回规范化的绝对路径名

6、stringdirname (string$path ):返回路径中的目录部分

mixedstr_replace ( mixed$search ,mixed$replace ,mixed$subject [,int&$count ] )

booldefine (string$name , mixed$value [,bool$case_insensitive = false ] )

mixedpathinfo ( string $path [, int $options ] )

void exit ([ string$status ] )
void exit ( int$status )
array array_diff ( array $array1 , array $array2 [, array $ ... ] )

array array_merge ( array $array1 [, array $array2 [, array $... ]] )

string ucfirst ( string $str )

bool class_exists ( string $class_name [, bool $autoload ] )

require_once()

require() 语句包含并运行指定文件。

bool ctype_digit ( string$text )
bool ctype_alnum ( string$text )

mixedset_error_handler (callable$error_handler [, int$error_types = E_ALL | E_STRICT ] )

array get_class_methods ( mixed$class_name )
array array_map ( callback$callback ,array$arr1 [,array$... ] )
bool in_array ( mixed$needle ,array$haystack [,bool$strict ] )
mixedcall_user_func_array (callable$callback , array$param_arr )


string get_class ([object $obj ] )

array get_class_methods (mixed$class_name )

array get_declared_classes (void )

int count ( mixed $var [, int $mode ] )

mixed end ( array &$array )

array explode ( string $separator , string $string [, int $limit ] )

string implode ( string $glue , array $pieces )

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值