Advertisement
garfield

[PHP]: Pegar sistema operacional com php.

Nov 2nd, 2012
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1.     echo GetUserWinVersion();
  2.     function GetUserWinVersion(){
  3.    
  4.         $UserStats  = php_uname();
  5.         $UserPos[2] = "";
  6.         $Percorrer  = 0;
  7.        
  8.         while ($Percorrer != strlen($UserStats)){
  9.        
  10.             if($UserStats[$Percorrer] == '('){
  11.                 $UserPos[0] = $Percorrer + 1;
  12.             }
  13.             if($UserStats[$Percorrer] == ')'){
  14.                 $UserPos[1] = $Percorrer;
  15.             }
  16.             $Percorrer ++;
  17.         }
  18.        
  19.         return substr($UserStats, $UserPos[0], $UserPos[1] - $UserPos[0]);
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement