This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| function verifyServerOnLine($server, $port) | |
| { | |
| $response = false; | |
| $fp = fsockopen($server, $port, $errno, $errstr, 3); | |
| if (!$fp) { | |
| throw new \Exception('Erro: nenhum servidor encontrado!'); | |
| } else { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| // texto padrão | |
| $text = 'texto padrão'; | |
| // senha | |
| $password = 'admin123'; | |
| // nomes | |
| $nomes = array('joão', 'maria', 'josé'); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| /** | |
| * Calcula digito verificador de CPF | |
| * @author Hélquisson Dourado | |
| */ | |
| function calcDigVerifCPF($num) { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| function fib($num) { | |
| $i = 1; | |
| $j = 0; | |
| for($k=0;$k<$num;$k++) { | |
| $t = $i + $j; | |
| $i = $j; | |
| $j = $t; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| header( 'Content-type: text/html; charset=utf-8' ); | |
| echo 'Resposta em:'; | |
| echo '<br/><br/>'; | |
| $i = 10; | |
| while ($i > 0) { | |
| echo $i; | |
| flush(); | |
| ob_flush(); | |
| sleep(1); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| include_once 'PHPMailer/class.phpmailer.php'; | |
| if( filter_has_var(INPUT_POST, 'enviar') ) { | |
| $arquivo = $_FILES['file']['tmp_name']; | |
| $name = $_FILES['file']['name']; | |
| $dir = 'upload/'; | |
| move_uploaded_file($arquivo, $dir.$name); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| session_start(); //iniciar sessão | |
| // cria variável de array se ainda não existir | |
| if ( !isset($_SESSION['produto']) ) { | |
| $_SESSION['produto'] = array(); | |
| } | |
| // adiciona produtos ao array | |
| if ( isset($_GET['prod']) ) { |