njcozw / util
Basic PHP package with utility functions like die and dump, generate password and logging to txt file
Installs: 40
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/njcozw/util
This package is not auto-updated.
Last update: 2025-10-15 06:52:50 UTC
README
Basic PHP package with utility functions like die and dump, generate password and logging to txt file
Usage
-
Die Dump
$data = [ 'test' => 'Test Data' ]; Util::dd($random_data); // Output Array ( [test] => Test Data )
same as:
die(var_dump($random_data))
-
Random String Generator
Util::generator($length_of_string); // e.g. 5 string chars plus current datetime //Output N5IN70322210903
-
Log
NOTE: Create a folder where txt logs will be stored e.g. logs in your project directory
Util::log($string_data, $location); // requires string data only
Getting Started
# Installation
composer require njcozw/util:dev-master
# In your src file
<?php
use App\Njcozw\Util;
require_once __DIR__ . '/vendor/autoload.php';
Util::log($string, $location);
?>