Un simple paquete de php que puede servir de utilidad a cualquiera con muchas herramientas que facilitan el desarrollo de proyectos mucho más rápido.
composer require abr4xas/utils
Then:
$ composer update
$ composer dumpautoload -o // optional
<?php
require 'vendor/autoload.php';
use Abr4xas\Utils\SeoUrl;
use Abr4xas\Utils\Gravatar;
use Abr4xas\Utils\TimeFormat;
use Abr4xas\Utils\SuggestKeyword;
use Abr4xas\Utils\PrettyPrintArray;
$slug = SeoUrl::generateSlug('this is an awesome string');
// this-is-an-awesome-string
$gravatar = Gravatar::getAvatarUrl('email@domain.tld', ['s' => 80, 'd' => 'mm', 'secure' => true]);
// https://secure.gravatar.com/avatar/0b84841f9b6236d312515dc83046078c?s=80&d=mm&r=g
$timeAgo = TimeFormat::timeAgo('2020-08-25');
// 21 hours ago
PrettyPrintArray::prettyPrintArray($var);
$keywords = SuggestKeyword::SuggestKeyword('php');
PrettyPrintArray::prettyPrintArray($keywords);
// Output:
// Array
// (
// [0] => php
// [1] => phpmyadmin
// [2] => php date
// [3] => phpstorm
// [4] => php online
// [5] => php array length
// [6] => php foreach
// [7] => phpunit
// [8] => php array
// [9] => php try catch
// )
<?php
use Abr4xas\Utils\RandomStringGenerator;
$token = (new RandomStringGenerator)->generate();
<?php
$customAlphabet = '0123456789ABCDEF';
// you can set the custom alphabet from the constructor
$token = (new RandomStringGenerator($customAlphabet))->generate();
// or you can set a new alphabet whenever needed like this:
$token = (new RandomStringGenerator)->setAlphabet($customAlphabet)->generate();
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.