<?php $str="I am a string with several periods.period #1. period #2."; $strings = explode('.', $str); $titleCased = []; foreach($strings as $s){ $titleCased[] = ucfirst(trim($s)); } echo join(".", $titleCased);
You have javascript disabled. You will not be able to edit any code.