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;
}

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.