You are here: Re: undefined array index question « PHP Programming Language « IT news, forums, messages
Re: undefined array index question

Posted by petermichaux on 09/18/05 19:42

I am trying to get a message something like your Notice message. What
do I need to change about my error handler? I thought my error handler
would catch Errors, Warnings, User Notices and Notices.

Thanks,
Peter

<?php

set_error_handler("my_error_handler", E_ALL);

function my_error_handler($errNo, $errStr, $errFile, $errLine)
{
$error_message = "\nERRNO: ". $errNo ."\nTEXT: " . $errStr . " \n" .
"LOCATION: " . $errFile . ", line " . $errLine . ", at "
..
date("F j, Y, g:i a") . "\n\n";


echo "<pre>" . $error_message . "</pre>";
exit;
}

$array['foo']=3;
echo 'M'.$array['foo'].'M';
//How can I index into the array to an index that doesn't exist?
echo 'M'.$array['bar'].'M';
?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация