Basic PHP package with utility functions like die and dump, generate password and logging to txt file
-
Die Dump
$data = [ 'test' => 'Test Data' ]; Util::dd($random_data); // Output Array ( [test] => Test Data )
die(var_dump($random_data))
-
Random String Generator
Util::generator($length_of_string); // e.g. 5 string chars plus current datetime //Output N5IN70322210903
-
Log
Util::log($string_data, $location); // requires string data only
# 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);
?>