Converting Strings to Upper/Lower Case in PHP

Q

How To Convert Strings to Upper or Lower Cases?

✍: FYIcenter.com

A

Converting strings to upper or lower cases are easy. Just use strtoupper() or strtolower() functions. Here is a PHP script on how to use them:

<?php
$string = "PHP string functions are easy to use.";
$lower = strtolower($string);
$upper = strtoupper($string);
print("$lower\n");
print("$upper\n");
print("\n");
?>

This script will print:

php string functions are easy to use.
PHP STRING FUNCTIONS ARE EASY TO USE.

 

PHP Built-in Functions for Strings

⇒⇒PHP Tutorials

2016-10-13, 200👍, 0💬