I need help doing this. i cant figure out how to return the boolean, and it seems that my condition's not working.
  <?php      $xml=simplexml_load_file("Details.xml") or die("Error: Cannot create object");      function SearchSu($Su1 , $Su2)  {      //boolean       $av1 = false; //false => the supervisor is not in the list (AVAILABLE)      $av2 = false;        //set the  supervisor      $Su1 = "591006125411"; //Bruno      $Su2 = "571121125351"; //Dayana        foreach($xml_array as $Employee) //problem occur here though      {          if($Su1 == $Employee->EmployeeNewIC) // true=>supervisor is out          {              //if supervisor1 is out, procees check with supervisor2              if($Su2 == $Employee->EmployeeNewIC )               {                     return $av1 = false; //true=>supervisor is out                 }              else if($Su2 !== $Employee->EmployeeNewIC) // false=>supervisor is available              {                   return $av2;                  }          }          else              return $av1;        }  SearchSu("591006125411","571121125351");    ?>      i would very much appreciate the help.
No comments:
Post a Comment