This file contains 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 | |
/** | |
* Description | |
* | |
* @author Seu nome <email@escape.ppg.br> | |
*/ | |
class NomeDaClasse extends EscapeWork | |
{ | |
This file contains 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 | |
interface Congratulations | |
{ | |
public function congrats(); | |
} | |
class OpenStack implements Congratulations | |
{ | |
static $instance; |
This file contains 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
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Carregando GIST's por ajax</title> | |
<style type="text/css"> | |
body { | |
font-family: Helvetica, sans-serif; | |
font-size: 13px; |
This file contains 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 | |
$str = "Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός"; | |
$str = mb_strtolower($str, 'UTF-8'); | |
echo $str; // Prints τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός |
This file contains 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 = 'ESTA É UMA FRASE COM ACENTUAÇÃO'; | |
echo strtolower( $texto ); // escreve: 'esta �� uma frase com acentua����o' | |
echo mb_strtolower( $texto, 'UTF-8' ); // escreve: 'esta é uma frase com acentuação' |
This file contains 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 | |
$cep = new Cep('SEU CEP'); | |
echo $cep->uf; | |
echo $cep->cidade; | |
echo $cep->bairro; | |
echo $cep->logradouro; |
This file contains 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 limitar($string, $tamanho, $encode = 'UTF-8') { | |
if( strlen($string) > $tamanho ) | |
$string = mb_substr($string, 0, $tamanho - 3, $encode) . '...'; | |
else | |
$string = mb_substr($string, 0, $tamanho, $encode); | |
return $string; | |
} |
This file contains 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 = 'Lorem Ipsum is simply dummy text of the printin'; | |
echo limitar($texto, 15); | |
// Escreve na tela "<strong>Lorem Ipsum i...</strong>" |
This file contains 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 | |
$Produto = EscapeWork::getClass('Produto'); |
This file contains 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 | |
$xml = '<Credenciais xmlns="http://sofis.com.br/"><codigo>'.self::CODIGO.'</codigo><senha>'.self::SENHA.'</senha></Credenciais>'; | |
$soapAuthVar = new SoapVar($xml, XSD_ANYXML, null, null, null); | |
$soapAuthHeader = new SoapHeader(self::WSDL, 'Credenciais', $soapAuthVar); | |
$this->soap->__setSoapHeaders( array($soapAuthHeader) ); |