downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

$HTTP_RAW_POST_DATA> <$_COOKIE
[edit] Last updated: Fri, 24 Jun 2011

view this page in

$php_errormsg

$php_errormsgپیام خطای قبلی

Description

$php_errormsg یک متغیر شامل متن خظای تولید شده توسط PHP است. این متغیر تنها در حوزه ایجاد خطا در دسترس خواهد بود و اگر گزینه تنظیمات track_errors روشن باشد (بصورت پیش‌فرض off است).

Note: این متغیر تنها در صورتی موجود است track_errors در php.ini فعال شده باشد.

Warning

اگر یک پردازنده خطای تعیین شده توسط کاربر در $php_erromsg موجود باشد اگر پردازنده خظا FALSE بازگرداند

Examples

Example #1 نمونه $php_errormsg

<?php
@strpos();
echo 
$php_errormsg;
?>

The above example will output something similar to:

Wrong parameter count for strpos()



$HTTP_RAW_POST_DATA> <$_COOKIE
[edit] Last updated: Fri, 24 Jun 2011
 
add a note add a note User Contributed Notes $php_errormsg - [3 notes]
up
1
ryan kulla
4 years ago
Note: This variable doesn't seem to get populated if you're running Xdebug.
up
3
quickshiftin at gmail dot com
4 months ago
While $php_errormsg is a global, it is not a superglobal.

You'll have to qualify it with a global keyword inside a function.

<?php
function checkErrormsg()
{
    global
$php_errormsg;
    @
strpos();
    return
$php_errormsg;
}
?>
up
0
josh at karmabunny dot com dot au
1 year ago
The track_errors parameter is PHP_INI_ALL, so you can use code like this:

<?php
ini_set
('track_errors', 1);

$result = @do_risky_thing();
if (!
$result) {
    echo
'<p>Error' . htmlspecialchars($php_errormsg) . '</p>';
}

ini_set('track_errors', 0);
?>

 
show source | credits | stats | sitemap | contact | advertising | mirror sites