Q:

Write a PHP program to decapitalize the first letter of the string and then adds it with rest of the string

0

Write a PHP program to decapitalize the first letter of the string and then adds it with rest of the string.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
//Licence: https://bit.ly/2CFA5XY

function decapitalize($string, $upperRest = false)
{
    return lcfirst($upperRest ? strtoupper($string) : $string);
}
print_r(decapitalize('Python'));

?>

Sample Output:

python

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now