How to load a 3rd party library -> scope problems??

#2
[eluser]Chris Newton[/eluser]
That script must have errors suppressed somewhere, or whatever normally calling it does, because that's definitely an error, and the error doesn't lie with CI or a scope change.

You should change

Code:
if ($arr[$k])

to

Code:
if (isset($arr[$k]))
or maybe
Code:
if(array_key_exists($k,$arr))


That should get rid of the undefined index error.... the script you have above assumes that $arr has an array index of $k, when $arr was just created a few lines above with no index in the name of $k... so, yeah, the index is undefined, at least on the first pass.


Messages In This Thread
How to load a 3rd party library -> scope problems?? - by El Forum - 04-22-2008, 10:01 AM
How to load a 3rd party library -> scope problems?? - by El Forum - 04-22-2008, 08:48 PM
How to load a 3rd party library -> scope problems?? - by El Forum - 04-22-2008, 10:41 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.