SEN-Solutions

You are here: Home R&D Blog PHP put first letter of a word in uppercase and the other letter in lowercase

PHP put first letter of a word in uppercase and the other letter in lowercase

03 Nov

We need to rewrite a chaine of text, to make the first letter in upper case and the other letters in lower case.

Exemple:

Chaine1= "THIS IS A TEXT AA";

Chaine2= "ThIS is A teXT Aa";

Solution:

echo ucfirst(strtolower(trim($cahine1))); // will print "This is a texte aa"

echo ucfirst(strtolower(trim($cahine2))); // will print "This is a texte aa"
Maher chakroun

All our stuff are available for your support.

Please contact us by email on contact@sen-solutions.com

Website: www.sen-solutions.com
Login to post comments

Sample image

Send us an This email address is being protected from spambots. You need JavaScript enabled to view it. or give us a call on (00216) 28 20 22 36

Location

  • Office 1: Sokra Road, km3, Bussiness incubator "Sfax innovation1" - Sfax 3052 - Tunisia.
  • Office 2: Majida Boulia Avenue, Monia Building, S3, O8. Sfax 3000. Tunisia.
  • (00216) 28 20 22 36

Newsletter

Follow SEN_Solutions on Twitter