shadiadiph Posted February 20, 2009 Share Posted February 20, 2009 I have been using ucwords($_POST items such as names so if the user inputs their name in lower case it should come out properly example simon lee becomes Simon Lee but one problem I have come accross is if the user types simon LEE it saves as Simon LEE ucwords doesn't seem to work with uppercase words?? I tried strtolower(ucwords($_POST to try to force it to lower string then to ucwords but that doesn't work any solutions out there? Link to comment https://forums.phpfreaks.com/topic/146101-solved-strtolower-and-ucwords-problem/ Share on other sites More sharing options...
Sangha-08 Posted February 20, 2009 Share Posted February 20, 2009 I have been using ucwords($_POST items such as names so if the user inputs their name in lower case it should come out properly example simon lee becomes Simon Lee but one problem I have come accross is if the user types simon LEE it saves as Simon LEE ucwords doesn't seem to work with uppercase words?? I tried strtolower(ucwords($_POST to try to force it to lower string then to ucwords but that doesn't work any solutions out there? Try something like <?php $query = $_GET['query']; $query = strtolower($query); $query = ucwords($query ); echo($query); ?> Link to comment https://forums.phpfreaks.com/topic/146101-solved-strtolower-and-ucwords-problem/#findComment-766996 Share on other sites More sharing options...
shadiadiph Posted February 20, 2009 Author Share Posted February 20, 2009 mm i have tried this which is producing the error Parse error: syntax error, unexpected ')' in /home/asiapaci/public_html/site/submit/newslsubmit.php on line 7 $name = strtolower($_POST["name"])); $email = strtolower($_POST["email"]); $name = ucwords($name); Link to comment https://forums.phpfreaks.com/topic/146101-solved-strtolower-and-ucwords-problem/#findComment-767000 Share on other sites More sharing options...
shadiadiph Posted February 20, 2009 Author Share Posted February 20, 2009 mm i have just seen the extra ) don't know how thay got in there Link to comment https://forums.phpfreaks.com/topic/146101-solved-strtolower-and-ucwords-problem/#findComment-767003 Share on other sites More sharing options...
shadiadiph Posted February 20, 2009 Author Share Posted February 20, 2009 ok thanks got it working now. :{ now i am going to have to go and change every other instance in my site Link to comment https://forums.phpfreaks.com/topic/146101-solved-strtolower-and-ucwords-problem/#findComment-767005 Share on other sites More sharing options...
Sangha-08 Posted February 20, 2009 Share Posted February 20, 2009 ok thanks got it working now. :{ now i am going to have to go and change every other instance in my site LOL, kk have fun Link to comment https://forums.phpfreaks.com/topic/146101-solved-strtolower-and-ucwords-problem/#findComment-767007 Share on other sites More sharing options...
Sangha-08 Posted February 20, 2009 Share Posted February 20, 2009 Oh also, could you please mark this topic as solved? thanks.` Link to comment https://forums.phpfreaks.com/topic/146101-solved-strtolower-and-ucwords-problem/#findComment-767009 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.