posix_strerror Retrieve the system error message associated with the given errno php函数


posix_strerror

(PHP 4 >= 4.2.0, PHP 5)

posix_strerrorRetrieve the system error message associated with the given errno

说明

string posix_strerror ( int $errno )

Returns the POSIX system error message associated with the given errno. You may get the errno parameter by calling posix_get_last_error().

参数

errno

A POSIX error number, returned by posix_get_last_error(). If set to 0, then the string "Success" is returned.

返回值

Returns the error message, as a string.

范例

Example #1 posix_strerror() example

This example will attempt to kill a process which does not exist, then will print out the corresponding error message.

<?php
posix_kill
(50,SIGKILL);
echo 
posix_strerror(posix_get_last_error())." ";
?>

以上例程的输出类似于:

No such process

参见

  • posix_get_last_error() - Retrieve the error number set by the last posix function that failed



相关阅读:
posix_times Get process times
posix_ttyname Determine terminal device name
posix_uname Get system name
pow 指数表达式
preg_filter 执行一个正则表达式搜索和替换
preg_grep 返回匹配模式的数组条目
preg_last_error 返回最后一个PCRE正则执行产生的错误代码
preg_match 执行一个正则表达式匹配
preg_match_all 执行一个全局正则表达式匹配
preg_quote 转义正则表达式字符
preg_replace 执行一个正则表达式的搜索和替换
preg_replace_callback 执行一个正则表达式搜索并且使用一个回调进行替换
preg_split 通过一个正则表达式分隔字符串
prev 将数组的内部指针倒回一位
快速导航

Copyright © 2016 phpStudy | 皖ICP备18014864号-4