We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,763 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Function problem

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 Hours
Discussion Span
9 Months Ago
Last Updated
2
Views
natehome
Newbie Poster
23 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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.

cereal
Veteran Poster
1,144 posts since Aug 2007
Reputation Points: 344
Solved Threads: 222
Skill Endorsements: 22

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0559 seconds using 2.65MB