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
function log($text) | |
{ | |
if(is_array($text) || is_object($text)){ | |
$text = http_build_query($text); | |
} | |
// open log file | |
$filename = "mylog.txt"; | |
$fh = fopen($filename, "a") or die("Could not open log file."); | |
fwrite($fh, date("d-m-Y, H:i")." - $text\n") or die("Could not write file!"); | |
fclose($fh); |
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 | |
/** | |
* Use os estilos .last e .last-row | |
* dentro do loop utiliando php | |
* para mostar os grupos conforme as imagens | |
* Grupo 1 : http://cl.ly/image/2r33391j2Q2w/grupo1.png | |
* Grupo 2 : http://cl.ly/image/0s1k0x1S1q2d/grupo2.png | |
* Grupo 3 : http://cl.ly/image/3D0g0a280d1Q/grupo3.png | |
* |
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 | |
/** | |
* The base configurations of the WordPress. | |
* | |
* This file has the following configurations: MySQL settings, Table Prefix, | |
* Secret Keys, WordPress Language, and ABSPATH. You can find more information | |
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing | |
* wp-config.php} Codex page. You can get the MySQL settings from your web host. | |
* | |
* This file is used by the wp-config.php creation script during the |
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 | |
// pasta onde se encontram os arquivos. Caminho completo ou relativo | |
$dir = './selecionadas/'; | |
// total de arquivos a serem renomeados. | |
$total = 106; | |
// prefixo do nome do arquivo | |
$prefix = 'arquivo'; |
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 | |
class MyClass | |
{ | |
public function strToDate( $str ) | |
{ | |
return new \DateTime($str); | |
} | |
} |
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 | |
$notFloat = '8521'; | |
//example 1: | |
var_dump(is_float($notFloat)); //bool(false) | |
//example 2: | |
var_dump(filter_var($notFloat, FILTER_VALIDATE_FLOAT)); //float(8521) | |
//example 3: | |
var_dump(is_float(filter_var($notFloat, FILTER_VALIDATE_FLOAT))); //bool(true) |
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 | |
$f = false; | |
$n = null; | |
$e = ''; | |
$z = 0; | |
if ($f === false) | |
echo '<br/> $f === false'; | |
if ($n === false) | |
echo '<br/> $n === false'; |
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
Baixe o iphoto no iphone ou ipad. | |
abra o iphoto | |
conecte o aparelho no maca | |
abra o aplicativo image capture | |
no iphoto va em photo stream | |
clique no botao "share", selecione, save to camera roll | |
escolha as fotos (max 100) e mande salvar no camera roll | |
no imagecapture, mande salvar as fotos no computador. | |
repita o processo até salvar todas as fotos |
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 | |
/* | |
* File: SimpleImage.php | |
* Author: Simon Jarvis | |
* Copyright: 2006 Simon Jarvis | |
* Date: 08/11/06 | |
* Link: http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php | |
* | |
* This program is free software; you can redistribute it and/or |
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
class Cep | |
{ | |
private $url = 'http://www.republicavirtual.com.br/web_cep.php?'; | |
private $cep, $formato, $consulta; | |
public $uf, $cidade, $bairro, $tipo_logradouro, $logradouro, $header; | |
public $resultado; | |
public function __construct($cep, $formato='query_string') | |
{ | |
$this->cep = preg_replace('([^0-9])', '', $cep); |