Jump to content

Undefined offset


eevan79

Recommended Posts

When I enable error_reporting this notice appear:

Notice:  Undefined offset:  1

 

This is code:

function get_value_of($name)
{
     $lines = file("../config.php");
     $val = array();
     foreach (array_values($lines) AS $line)
     {
          list($key, $val) = explode('=', trim($line) );
          if (trim($key) == $name)
          {     $val = convEnt($val);
                return $val;
          }
     }
     return false;
} 

 

Error is in this line:

 list($key, $val) = explode('=', trim($line) );

 

How to fix this?

Link to comment
https://forums.phpfreaks.com/topic/211198-undefined-offset/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.