I have the following paragraph :
This is the first line.
this is the second line.
we live in Europe.
this is the fourth line.
I want to convert the first character to uppercase
in every newlines.
So the paragraph should look like this :
This is the first line.
This is the second line.
We live in Europe.
This is the fourth line.
So far, I am able to convert the first character to uppercase, but it converts first characters in every words not in newlines using the ucfirst()
and ucword()
echo ucfirst($str);
Is there a way to solve this using ucfirst()
or preg_replace()
function ?
Thanks!