开发者

codeigniter error in page source view

开发者 https://www.devze.com 2023-01-13 02:21 出处:网络
I\'m working with one array that have 55 elements inside and each one are another array with 17 elements each one.

I'm working with one array that have 55 elements inside and each one are another array with 17 elements each one.

When I show the array on the screen, nothing wrong happens but when I take a look in the page source, I have 55 x 17 "Severity: Notice" errors with the message "Undefined index".

Does someone know what can be wrong?

If the index really doesn't exist, I couldn't see the array on the screen.

I tested using if ( isset( ) ) { ... }, but still the same.

Codeigniter version: 1.7.2

Browsers tested: firefox, chrome, i开发者_C百科e and safari.


I usually get this errors when I'm trying to echo something that is not defined. It's not an PHP error, only a notice. This is produced by the function error_reporting(); on the main index.php.

If you open this index.php file, you will see:

/*
|---------------------------------------------------------------
| PHP ERROR REPORTING LEVEL
|---------------------------------------------------------------
|
| By default CI runs with error reporting set to ALL.  For security
| reasons you are encouraged to change this when your site goes live.
| For more info visit:  http://www.php.net/error_reporting
|
*/
    error_reporting(E_ALL);

You've two options:

  1. Don't print a variable that is not defined.
  2. Change the error_reporting(); with a non-notice prints. Like: error_reporting(E_ALL & ~E_NOTICE);.

Wish this helps you!


This has nothing to do with CI or your browser, it is a classic PHP notice.

0

精彩评论

暂无评论...
验证码 换一张
取 消