Keys →
Functions ↓
function shift ( $str, $mode=0 ) {#-k equiv string#- perform shift ops on a string, because I can't remember the stupid naming non-convention of PHP#-p $mode - opt - 0 = upshift#-p - 1 = downshift#-p - 2 = sentence (capitalize 1st word)#-p - 3 = title (capitalize evry word)#-p - 4 = name case (deals with Jean-Luc and O'Brien)#-c credit #4 jmarois@ca.ibm.com in https://www.php.net/manual/en/function.ucwords.php#-d 2/11/21 Added switch ($mode) {default:case 0: $str = strtoupper ( $str ); break;case 1: $str = strtolower ( $str ); break;case 2: $str = ucfirst ( $str ); break;case 3: $str = ucwords ( $str, " \t\r\n\f\v" ); break;case 4: $str = ucwords ( strtolower($str) ); foreach ( array('-', '\'') as $del ) { if (strpos($str, $del) !== false) { $str = implode ( $del, array_map ( 'ucfirst', explode($del, $str) ) ); } } break; } return $str; }?>