PHP ships with dozens of built-in string utilities. Here are the ones you will use almost daily:
strlen($str)/mb_strlen($str)— String length (usemb_*for UTF-8/emojis)trim($str)— Strips whitespace from both endsstrtolower()/strtoupper()— Case conversionstr_replace($search, $replace, $subject)— Find and replace textexplode($sep, $str)/implode($sep, $arr)— Split string into array / Join array into string
ADVERTISEMENT