smartguyin Posted January 3, 2007 Share Posted January 3, 2007 i want to convert the first letter in variable in caps.suppose...$var = "abc";i want to display it like >>>> [b]Abc[/b]And if i want to convert all characters in caps then wht should i do... Quote Link to comment Share on other sites More sharing options...
marcus Posted January 3, 2007 Share Posted January 3, 2007 [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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.