PHP

Changing case

The following PHP functions return a copy of the subject string with changes in the case of the characters:

strtolower

    string strtolower(string subject)

Example:

	print strtolower("PHP and MySQL");
	//Output: php and mysql

strtoupper

    string strtoupper(string subject)

Example:

	print strtoupper("php and mysql");
	//Output: PHP AND MYSQL

ucfirst

    string ucfirst(string subject)

Example:

	print ucfirst("now is the time");
	//Output: Now is the time

ucwords

    string ucwords(string subject)

Example:

	print ucfirst("now is the time");
	//Output: Now Is The Time
by BrainBellupdated
Advertisement: