This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param mixed $value Value of any PHP type. | |
* @return string Value as readable string. | |
*/ | |
function toString($value, $compactArray = true): string | |
{ | |
$data_type = ''; | |
if (is_array($value)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// From old versions of Laravel | |
// Don't use in cryptography | |
function str_random($length = 16) | |
{ | |
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
return substr(str_shuffle(str_repeat($pool, $length)), 0, $length); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Related SO disscussion: | |
// https://stackoverflow.com/questions/52348483/pdo-mysqli-memory-leak-on-multiple-select-queries | |
$dbParams = [ | |
'host' => 'localhost', | |
'dbname' => 'playground', | |
'username' => 'homestead', | |
'password' => 'secret', | |
]; |
NewerOlder