ucfirst()
functionYou can use the PHP ucfirst()
function to change the first character of a string to uppercase (i.e. capital). Alternatively, you can use the strtolower()
function in combination with the ucfirst()
function, if you want to make only first letter of the string to uppercase and rest of the string to lowercase. Let's check out an example to understand how it works:
<?php
$str1 = 'the color of the sky is blue.';
echo ucfirst($str1);
echo "<br>";
$str2 = 'the Color of the Sky is Blue.';
echo ucfirst(strtolower($str2));
?>
i hope you like this article.
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
How To Connect MongoDB in Express Application
In this article, i will share with you h...How to Insert an Item into an Array at a Specific Index in JavaScript
Use the JavaScript splice() Method Yo...Django 3 CRUD Tutorial Example with MySQL and Bootstrap
Django 3 is released with full async sup...Syntax error or access violation: 1055 'posts.views' isn't in GROUP BY
While working with Laravel database quer...Automatic Page Load and Ajax Request Progress Bar with Pace.js
Pace.js is the simple javascript library...