Only attempt to show initials if not empty

This commit is contained in:
Marcus Hill
2022-12-11 01:32:14 +00:00
parent 69dbb51e93
commit a0233c77ec
2 changed files with 7 additions and 4 deletions
+1
View File
@@ -0,0 +1 @@
<?php
+2
View File
@@ -35,11 +35,13 @@ function key32gen()
} }
function initials($str) { function initials($str) {
if(!empty($str)){
$ret = ''; $ret = '';
foreach (explode(' ', $str) as $word) foreach (explode(' ', $str) as $word)
$ret .= strtoupper($word[0]); $ret .= strtoupper($word[0]);
return $ret; return $ret;
} }
}
function removeDirectory($path) { function removeDirectory($path) {
if (!file_exists($path)) { if (!file_exists($path)) {