PHP code example of aristidesneto / helpers

1. Go to this page and download the library: Download aristidesneto/helpers library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aristidesneto / helpers example snippets




use Aristides\Helpers\Helpers;
use Aristides\Helpers\Validations;

// Validações
Validations::cpf('123.456.789-10'); // true or false

Validations::cnpj('11222333444455'); // true or false

Validations::email('[email protected]') // true or false

// Helpers
Helpers::formatMoneyToReal('1485.48'); // 1.485,48
Helpers::formatMoneyToReal('873.11', true); // R$ 873,11

Helpers::formatMoneyToDatabase('45.367,98'); // 45367.98
Helpers::formatMoneyToDatabase('R$ 88.475.411,89'); // 88475411.89

Helpers::transformMonth(3); // Março
Helpers::transformMonth(3, false); // Mar

Helpers::transformWeekDays(2); // Segunda-feira
Helpers::transformWeekDays(2, false); // Seg

Helpers::mask('(##) #####-####', '12999887766'); // (12) 99988-7766
Helpers::mask('##.###.###/####-##', '41636863000137'); // 41.636.863/0001-37