位置: 编程技术 - 正文

PHP:class_implements()的用法_spl函数

编辑:rootadmin
class_implements

推荐整理分享PHP:class_implements()的用法_spl函数,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 5 >= 5.1.0)

class_implements — 返回指定的类实现的所有接口。

说明 array class_implements ( mixed $class [, bool $autoload ] )

本函数返回一个数组,该数组中包含了指定类class及其父类所实现的所有接口的名称。

参数

class

对象(类实例)或字符串(类名称)。

autoload PHP:class_implements()的用法_spl函数

是否允许使用__autoload 魔术函数来自动装载该类。默认值为TRUE。

返回值

调用成功则返回一个数组,否则返回FALSE。

更新日志

版本 说明 5.1.0 增加了允许参数class为字符串的选项。增加了autoload参数。

范例

Example #1 class_implements() example

<?phpinterfacefoo{}classbarimplementsfoo{}print_r(class_implements(newbar));//sincePHP5.1.0youmayalsospecifytheparameterasastringprint_r(class_implements('bar'));function__autoload($class_name){require_once$class_name.'.php';}//use__autoloadtoloadthe'not_loaded'classprint_r(class_implements('not_loaded',true));?>

以上例程的输出类似于:

参见

class_parents() - 返回指定类的父类。 get_declared_interfaces() - 返回一个数组包含所有已声明的接口

PHP:uniqid()的用法_misc函数 uniqid(PHP4,PHP5)uniqid生成一个唯一ID说明stringuniqid([string$prefix=[,bool$more_entropy=false]])获取一个带前缀、基于当前时间微秒数的唯一ID。参数prefix有用的参数。

PHP:unpack()的用法_misc函数 unpack(PHP4,PHP5)unpackUnpackdatafrombinarystring说明arrayunpack(string$format,string$data)Unpacksfromabinarystringintoanarrayaccordingtothegivenformat.Theunpackeddataisstoredinanassociativearray.To

PHP:usleep()的用法_misc函数 usleep(PHP4,PHP5)usleep以指定的微秒数延迟执行说明voidusleep(int$micro_seconds)以指定的微秒数延缓程序的执行。参数micro_seconds暂停的时间以微秒计。1微秒(micro

本文链接地址:https://www.jiuchutong.com/biancheng/280619.html 转载请保留说明!

上一篇:PHP:class_uses()的用法_spl函数

下一篇:PHP:uniqid()的用法_misc函数(phpunicode)

免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

鄂ICP备2023003026号

网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

友情链接: 武汉网站建设 电脑维修 湖南楚通运网络