• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
array helper - element()

#1
Moving to 3.0 I found that the function element() doesn't check if the 2nd parameter is an array as in the 2.0, giving error.
better to change in:

function element($item, $array, $default = NULL)
{
return is_array($array) ? (array_key_exists($item, $array) ? $array[$item] : $default) : $default;
}
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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