Jump to content

[SOLVED] Turn to character to caps in Variable


smartguyin

Recommended Posts

[code]
<?php
$var = "abc";

if(!is_numeric($var)){
$words = ucwords($var);
echo $words;
//will show Abc
}else {
die("bad");
}
?>
[/code]

For all caps:

[code]
<?php
$var = "abc";
if(!is_numeric($var)){
$words = strtoupper($var);
echo $var;
//will show ABC
}else {
die("bad");
}
?>
[/code]

-in school, i rock

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.