General-purpose PHP utility classes. Requires PHP 8.0+.
# ────────────────────────────────────────────────────────── #
# #
# $$\ $$\ $$$$$$$$\ $$$$$$\ $$\ $$$$$$\ #
# $$ | $$ |\__$$ __|\_$$ _|$$ | $$ __$$\ #
# $$ | $$ | $$ | $$ | $$ | $$ / \__| #
# $$ | $$ | $$ | $$ | $$ | \$$$$$$\ #
# $$ | $$ | $$ | $$ | $$ | \____$$\ #
# $$ | $$ | $$ | $$ | $$ | $$\ $$ | #
# \$$$$$$ | $$ | $$$$$$\ $$$$$$$$\\$$$$$$ | #
# \______/ \__| \______|\________|\______/ #
# #
# ────────────────────────────────────────────────────────── #
# ----[ General but useful PHP utilities. ]------------- #
# ----[ Made with ❤️ by darknetzz ]------------- #
# ----[ https://github.com/Darknetzz/ ]------------- #
# ────────────────────────────────────────────────────────── #
This library includes a bunch of useful tools for PHP. I wrote this because I kept re-inventing the wheel every time I started a new PHP project. There are other more complete alternatives out there (like Laravel), this was just made for fun and to learn.
Simply open your PHP project and clone this repo.
git clone git@github.com:Darknetzz/php-utils.git
Then include the library. You can use Composer autoload (recommended) or _All.php:
Using Composer (recommended):
composer require darknetzz/php-utilsrequire_once __DIR__ . '/vendor/autoload.php';
use PHPUtils\Crypto;
$crypto = new Crypto();
$hashedPassword = $crypto->hash("MyPassword123");Using _All.php (e.g. when cloned as a subfolder):
include_once("php-utils/PHPUtils/_All.php"); // adjust path if your folder name differs
use PHPUtils\Crypto;
$crypto = new Crypto();
$hashedPassword = $crypto->hash("MyPassword123");API documentation is generated in the Docs/ folder. Class reference:
- API
- Auth
- Calendar
- Crypto
- Debugger
- Files
- Funcs
- Images
- Navigation
- Network
- Random
- Resources
- Session
- SQL
- SQLite
- Strings
- Times
- Vars
See CHANGELOG.md for recent improvements (strict types, exception-based error handling, new tests, CI).
- Tests:
composer install && vendor/bin/phpunit - CI: GitHub Actions run PHPUnit on PHP 8.0–8.4 (see .github/workflows/php.yml).