homer.favenir Posted July 25, 2008 Share Posted July 25, 2008 hi, can anyone please help me on how to make a string with asterisk as marker from uppercase to lowercase. $string1 = MC*GILL U-QUEBEC, CANADA '91 ; $string2 = U*C SAN FRANCISCO-C*A '94; $string3 = U *OF ILLINOIS-CHICAGO '71; //expected output of each variables McGill U-Quebec, Canada '91; UC San Francisco-CA '94; U of Illinois-Chicago '71; please thanks Quote Link to comment Share on other sites More sharing options...
effigy Posted July 25, 2008 Share Posted July 25, 2008 I don't see how the asterisks play a part and I don't think you can do this without setting up various contextual patterns, e.g., one that checks for state abbreviations. If you have Perl access, you can try Text::Autoformat. Quote Link to comment Share on other sites More sharing options...
homer.favenir Posted July 26, 2008 Author Share Posted July 26, 2008 my string has asterisk on it, and that is the way i will receive the string. or maybe i can eliminate the asterisk and use regex uppercase function. this will make the string in normal upper-lower. is that right? thanks Quote Link to comment Share on other sites More sharing options...
homer.favenir Posted July 26, 2008 Author Share Posted July 26, 2008 i have problem with uppercase $x = '23ABARQUEZ-AGCAOILI, CARMENCITA IM CCM PUD U *OF *THE EAST-PHILIPPINES \'80'; echo ucfirst(strtolower($x)); it returns to lower still. it didnt change to uppercase first. please advice. thanks 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.