How To Convert Strings to Upper or Lower Cases

Q

How To Convert Strings to Upper or Lower Cases? - PHP Script Tips - PHP Built-in Functions for Strings

✍: 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.

2007-04-21, 5586👍, 0💬