scarhand Posted April 6, 2009 Share Posted April 6, 2009 ive got a string: 55 | 30 i want to use preg_replace to make it look nicer, i.e: 55 | 30 You can see there is a line break there too I want to get rid of. edit: can a mod move this to regex? my bad. Quote Link to comment Share on other sites More sharing options...
thepip3r Posted April 6, 2009 Share Posted April 6, 2009 explode on pipe (|), trim() all whitespace, implode with the desired whitespace -- although, your data resulting like that points to something else not trimming white-space initially - might want to start there. =P Quote Link to comment Share on other sites More sharing options...
scarhand Posted April 6, 2009 Author Share Posted April 6, 2009 wow didnt think of that, 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.