Advertisement
DraKiNs

[PHP] Respawn Generator Pawn

Nov 4th, 2011
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.20 KB | None | 0 0
  1. /*================================================================
  2.          _ ____ _____ __ __
  3.         (_) _ \ ___ | _ _ | _ __ __ | \ / |
  4.         | | | _) / __ | | | / _ \ / _ `| | \ / | |
  5.         | | __ / \ __ \ | | __ / (_ | | | | |
  6.         |_|_| |___/ | _ | \ ___ | \ __,_|_| | _ |
  7.  
  8.             Criado por Bruno da Silva
  9.             www.ips-team.blogspot.com
  10.                 Respawn Generator
  11.  
  12. ===============================================================*/
  13.  
  14. <form action="#" method="post">
  15.     <TEXTAREA name="CODIGO" rows="20" cols="50" tabindex="40"> </TEXTAREA>
  16.     <input type="submit" value="Submit" />
  17. </form>
  18.  
  19. <?php
  20.  
  21.     if(isset($_POST['CODIGO']))
  22.     {
  23.         $linhasTotais = explode("\n", $_POST['CODIGO']);
  24.         $contarLinhas = count($linhasTotais);
  25.  
  26.         foreach($linhasTotais as  $linhaAtual)
  27.         {              
  28.             if(!strlen($linhaAtual))   
  29.             {
  30.                 break;
  31.             }
  32.  
  33.             $partesLinha = explode(",", $linhaAtual);
  34.            
  35.             $contarLinhas--;
  36.  
  37.             if($contarLinhas)
  38.             {
  39.                 echo "{" . $partesLinha[0] . "," .  $partesLinha[1] . "," . $partesLinha[2] . "}," . "<br/>";
  40.             }
  41.             else
  42.             {  
  43.                 echo "{" . $partesLinha[0] . "," .  $partesLinha[1] . "," . $partesLinha[2] . "}" . "<br/>";
  44.             }
  45.        
  46.         }
  47.     }
  48.  
  49. ?>
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement