Skip to content

Instantly share code, notes, and snippets.

# Whatsapp
0.0.0.0 account.whatsapp.com
0.0.0.0 alpha.whatsapp.com
0.0.0.0 api.whatsapp.com
0.0.0.0 autodiscover.whatsapp.com
0.0.0.0 beta.whatsapp.com
0.0.0.0 betablog.whatsapp.com
0.0.0.0 blog.whatsapp.com
0.0.0.0 chat.whatsapp.com
0.0.0.0 crashlogs.whatsapp.net
<?php
if (!session_id()) {
session_start();
}
define('__ROOT__', dirname(__FILE__));
// Importar a classe do PHPMailer
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
<?php
if (!function_exists('email')) {
/**
* @param array|string $email
* @param string $assunto
* @param string $corpo
* @param string @replyTo
* @return boolean
*/
function email($email = null, $assunto = '(Sem Assunto)', $corpo = null, $replyTo = retorno@exemplo.com")
@apertaoxis
apertaoxis / bootstrap.php
Created July 29, 2018 22:13
Funções uteis
<?php
if (!function_exists('filter')) {
/**
* @param int $source
* @param string $index
* @return mixed
*/
function filter($source, $index)
{
return filter_input($source, $index);
<?php
define('ROOT', rtrim($_SERVER['DOCUMENT_ROOT'], '/'));
require ROOT.'/src/config.inc.php';
sleep(2);
$nome = trim(post('nome', FILTER_SANITIZE_STRING));
$email = strtolower(post('email', FILTER_SANITIZE_EMAIL));
$senhas = [post('senha'), post('senha2')];
$nascimento = convert_date(post('nascimento'), 'Y-m-d');
$genero = post('genero');
<?php
if (!function_exists('idade')) {
/**
* @param string $date (null)
* @param string $formato (null)
* @return int
*/
function idade($date = null, $formato = null)
{
<?php
if (!function_exists('remove_html_comments')){
/**
* @param string $content (html)
* @return string
*/
function remove_html_comments($content = null)
{
$result = preg_replace('/<!--(.|\s)*?-->/', '', $content);