mattm1712 Posted September 22, 2012 Share Posted September 22, 2012 i am using xml files where the data i am getting is in different formats so say i am getting DOG from one xml, Dog from another and finally dog from the last one so i am getting DOG,Dog and dog say i wanted them to be displayed all as Dog before i put them in to my database how would this be done? i know i can do it like this but its a bit long winded If($var=DOG) { $name = "Dog": } but i dot want to be doing this for all my data cheers matt Quote Link to comment https://forums.phpfreaks.com/topic/268662-is-this-possible/ Share on other sites More sharing options...
kicken Posted September 22, 2012 Share Posted September 22, 2012 Run them through strtolower first to make everything lowercase, then run them through ucfirst to make the first letter uppercase. Quote Link to comment https://forums.phpfreaks.com/topic/268662-is-this-possible/#findComment-1379999 Share on other sites More sharing options...
trq Posted September 22, 2012 Share Posted September 22, 2012 $str = ucfirst(strtolower($str)); Quote Link to comment https://forums.phpfreaks.com/topic/268662-is-this-possible/#findComment-1380000 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.