0

can any body tell me why this isnt working, thanks

function getInfo()
{
  $iniData = parse_ini_file( "jquery_msg_admin/data/php_browscap.ini", true );
  foreach($iniData as &$row){
    if(fnmatch($pattern,$_SERVER['HTTP_USER_AGENT'])){
      foreach($iniData as $parent => $parentparameters){
    if($parameters['Parent']==$parent){ 
      foreach($iniData as $parentparent => $parentparentparameters){
        if($parentparameters['Parent']==$parentparent){ 
          $out = array_merge($parentparentparameters,$parentparameters,$parameters);
        }
      }
    }
      }
      break;
    }
  }
  return $out;
}
2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by cereal
0

The first argument of fnmatch() is the pattern to match, but this variable is not defined inside the function, so this can be a problem, the same seems to happen with $parameters at line 7.

But a part that, what kind of error do you get?

Try to place some echoes or die() inside each level of the function to get the exact point where the error occours, or add error_reporting(-1); at the top of the script to get the output errors.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.