[Solved] Replace first word of sentence to the end if it is “the” [closed]
Please try this: <? $str=”The Hunger Games”; if (strtolower(substr($str,0,3)) == “the”){ $str = trim(substr($str,3)).’, The’; } echo $str; ?> WORKING CODE 3 solved Replace first word of sentence to the end if it is “the” [closed]