Change the color of the first character of each word in the given string
No input available.";
} else {
echo "
Original sentence:
" . htmlspecialchars($sentence);
// Change color of first character of each word
$modified = preg_replace(
'/(\b[a-zA-Z])/i',
'\1',
htmlspecialchars($sentence)
);
echo "
Modified sentence:
" . $modified;
}
}
?>