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... Link to comment https://forums.phpfreaks.com/topic/32737-solved-turn-to-character-to-caps-in-variable/ 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 Link to comment https://forums.phpfreaks.com/topic/32737-solved-turn-to-character-to-caps-in-variable/#findComment-152389 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.