Jump to content

Passing Conditional Statement to Function


ernest

Recommended Posts

hi

 

i am trying to pass a conditional statement to a function, but unsuccessful with many attempts. Any comment or solution? Thanks for helping :)

 

The following is a simplied sample of what i am trying to do:

 

$group = set_group('$r > 1');

 

function set_group($query){

     

      if ($query) {  //does not have the effect of "if ( $r > 1)", using "if("$query")" does not work either!!

      $group = 1;

      }

      return $group;

}

 

 

 

Thanks a lot

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.