Make First Letter Uppercase and the Rest Lowercase in a String using PHP

ucfirst & strtolower functions

<?php

$text = 'hello WORLD';
$result = ucfirst(strtolower($text));

echo $result; // Hello world

Leave a Comment

Cancel reply

Your email address will not be published.