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

Author Topic: how to use PHP to convert text between uppercase and lowercase ?  (Read 3497 times)

Offline lamnzxzfdTopic starter

  • Trade Count: (0)
  • Semi-Newbie
  • *
  • Thank You 0
  • Posts: 16
  • Karma: 0
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.


Offline keith.bowman

  • Trade Count: (0)
  • Semi-Newbie
  • *
  • Thank You 0
  • Posts: 10
  • Karma: 0
  • Gender: Male
You can use strtolower () to make a string lower
For example string strtolower (string $string)
Asuem Infotech [nofollow]

Offline nino

  • Trade Count: (0)
  • Newbie
  • *
  • Thank You 0
  • Posts: 1
  • Karma: 0
    • B2B portal
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');

Offline uditsh

  • Trade Count: (0)
  • Semi-Newbie
  • *
  • Thank You 0
  • Posts: 28
  • Karma: 0
strtoupper() - converts a string to uppercase.
strtolower() - converts a string to lowercase.

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

OP:
GOOD MORNING

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
1957 Views
Last post 09-06-2011, 03:44:27
by Walalayo
1 Replies
1465 Views
Last post 04-16-2013, 04:42:43
by semontuffel
0 Replies
1605 Views
Last post 01-05-2016, 04:18:05
by chinmay.sahoo
0 Replies
633 Views
Last post 03-29-2016, 02:42:10
by chinmay.sahoo
1 Replies
775 Views
Last post 04-20-2016, 02:56:22
by TomClarke