4 ms·
I make lowerTrim and upperTrim functions in any language I work in - change the case and trim the string. Makes things pretty easy. // PHP example func
by chime 15y ago
I make lowerTrim and upperTrim functions in any language I work in - change the case and trim the string. Makes things pretty easy.
// PHP example
function lowerTrim($t) {
return strtolower(trim($t));
}
I also have matchLeft and matchRight which take two strings and return true if both strings are non-blank and the shorter matches the longer string's prefix/suffix.
My most-used function during debug-phase is pR:
// especially useful when dealing with PHP arrays/objects
function pR($a)
{
echo '<pre>';
print_r($a);
exit;
}