Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 26th, 2012  |  syntax: None  |  size: 0.42 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?
  2. function getOnOff() {
  3.     return fgets($handle);
  4. }
  5.  
  6. function maintenanceCheck ()
  7. {
  8.  
  9.     // open the onoff switch and have a look
  10.  
  11.     $handle = fopen("onoff.php", "r");
  12.     $onoff = getOnOff();
  13.  
  14.     if (!feof($handle)) {
  15.         echo "<P>Error: unexpected fgets() fail\n";
  16.     }
  17.  
  18.     fclose($handle);
  19.     echo "<P>after fclose common fns onoff says $onoff";
  20.  
  21.     $result = $onoff;
  22.  
  23.     return $result;
  24.  
  25. }