Ansel_Tk1 Posted August 24, 2010 Share Posted August 24, 2010 Hi - wondering if someone can give a little guidance: Why doesn't this trim the whitespace out of the string postzip? trim(strtoupper(((isset($_POST["postzip"]))?$_POST["postzip"]:""))) Thanks Link to comment https://forums.phpfreaks.com/topic/211612-newb-trim-and-strtoupper/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 24, 2010 Share Posted August 24, 2010 If that's the whole line of code, you are not assigning the result to anything, so it is lost. Posting your actual code that exhibits the problem and showing a data value that does not work would certainly help someone help you. Link to comment https://forums.phpfreaks.com/topic/211612-newb-trim-and-strtoupper/#findComment-1103114 Share on other sites More sharing options...
AbraCadaver Posted August 24, 2010 Share Posted August 24, 2010 Yes, you've just plugged things in in some random order. You want something like this: $postzip = isset($_POST["postzip"]) ? trim(strtoupper($_POST["postzip"])) : ""; Link to comment https://forums.phpfreaks.com/topic/211612-newb-trim-and-strtoupper/#findComment-1103171 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.