$inputString = 'hello world';
$titleCaseString = ucwords($inputString);
echo $titleCaseString;
code
Convert String to Title Case
String manipulation
ucwords
title case