Eaddy Barnes
asked on
Changing the CASE of letters in Output
Hello Folks,
I would like to change the upper case of certain letters of the output from a certain column in a table..
e.g 1 here making the first letter in the output in Caps and the rest in all lowercase letters
before:
select , description, price from tbl_name
output SONY BLU-RAY INTERNAL DRIVE SATA (BLACK), $9.99
after:
select , description, price from tbl_name
output Sony blu-ray internal drive(black), $9.99
e.g 2 here making the first letter of every word in the output in Caps and the rest in all lowercase letters
before:
select , description, price from tbl_name
output SONY BLU-RAY INTERNAL DRIVE SATA (BLACK), $9.99
after:
select , description, price from tbl_name
output Sony Blu-ray Internal Drive(Black), $9.99
thanks in advance
I would like to change the upper case of certain letters of the output from a certain column in a table..
e.g 1 here making the first letter in the output in Caps and the rest in all lowercase letters
before:
select , description, price from tbl_name
output SONY BLU-RAY INTERNAL DRIVE SATA (BLACK), $9.99
after:
select , description, price from tbl_name
output Sony blu-ray internal drive(black), $9.99
e.g 2 here making the first letter of every word in the output in Caps and the rest in all lowercase letters
before:
select , description, price from tbl_name
output SONY BLU-RAY INTERNAL DRIVE SATA (BLACK), $9.99
after:
select , description, price from tbl_name
output Sony Blu-ray Internal Drive(Black), $9.99
thanks in advance
Hi,
example 1:
$mystring = "HELLO HOW ARE YOU TODAY";
$mystring = ucfirst(strtolower($mystri ng));
example 2:
$mystring = "HELLO HOW ARE YOU TODAY";
$mystring = ucwords($mystring);
example 1:
$mystring = "HELLO HOW ARE YOU TODAY";
$mystring = ucfirst(strtolower($mystri
example 2:
$mystring = "HELLO HOW ARE YOU TODAY";
$mystring = ucwords($mystring);
lol, beat me to it smadeira... :P
ASKER
hey guys i'm not using php at all for the output only mysql queries.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Why is it in the PHP zone then ? You are using PHP, there has to be some layer between the database and the page. And the easiest way to do what you want is to present data like jrm213jrm213 did.
ASKER
It being in PHP Zone was my error..
$string = ucfirst(strtolower($string
example two you could use:
$string = ucwords(strtolower($string
May be some issues with the words inside (), though. You will need to play with it.