how to use PHP to convert text between uppercase and lowercase ?

Started by lamnzxzfd, 12-28-2011, 01:33:50

Previous topic - Next topic

lamnzxzfdTopic starter

One of the nice things about working with strings in PHP is its huge range of built-in string-handling functions. If you want to do something to a string, chances are there's a PHP function to do it for you! Can you show me how to use PHP to convert text between uppercase and lowercase ?

Thanks in advance.
  •  


keith.bowman

You can use strtolower () to make a string lower
For example string strtolower (string $string)
Asuem Infotech [nofollow]
  •  


nino

Hi,

it is even better to use mb_strtolower. This one will convert also special signs. Here is the example:

$text = mb_strtolower($text, 'UTF-8');
  •  

uditsh

strtoupper() - converts a string to uppercase.
strtolower() - converts a string to lowercase.

Ex:
<?php
echo strtoupper("good morning");
?>

OP:
GOOD MORNING
  •