Kingy Posted November 12, 2007 Share Posted November 12, 2007 I've made the roomlist for my server but as you can see the topics look pretty out of it with all the colour codes and what not. Is there a code that can clean it up a little. View roomlist here http://k1.ath.cx/roomlist.php Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted November 12, 2007 Share Posted November 12, 2007 Your going to have to explain exactly what you want cleaned up. I'm not sure if what your asking has anything to do with PHP, but from the sound of things it seems like it should be in the HTML or CSS section. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 12, 2007 Share Posted November 12, 2007 you mean all the non utf-8 characters? Quote Link to comment Share on other sites More sharing options...
Kingy Posted November 12, 2007 Author Share Posted November 12, 2007 Well obviously you can see ,12|12,6|13,6|6,13|4,13|13,4|7,4|4,7|8,7|7,8|9,8|8,9|10,9|9,10|12,10|10,12|16,12 0, etc etc throughout all the topics and little random ? marks. They are all irc colours etc so is there neway to get rid of them. So instead of having 6,12|12,6|13,6|6,13|4,13|13,4|7,4|4,7|8,7|7,8|9,8|8,9|10,9|9,10|12,10|10,12|16,12 0,4 Welcome To YAHTZEE Type !Help For More Info AND HAVE A GAME!! 10,12|12,10|9,10|10,9|8,9|9,8|7,8|8,7|4,7|7,4|13,4|4,13|6,13|13,6| I would just have Welcome to YAHTZEE Type !Help For More Info AND HAVE A GAME Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 12, 2007 Share Posted November 12, 2007 use regex and only take: Any letter Uppercase or Lower Case Any Number `~!@#$%^&*())_<>,.? and then do a regex replace of all things that are not the above pattern with nothing and it should help (make sure you are inclusive on spaces), odds are you can find the pattern online somewhere Quote Link to comment Share on other sites More sharing options...
Kingy Posted November 12, 2007 Author Share Posted November 12, 2007 ok ive never really used regex before. would you or anybody be able to give me either a code for doing the above or just a small code to help me on my way? Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 12, 2007 Share Posted November 12, 2007 $string = 'Welcome To YAHTZEE Type !Help For More Info AND HAVE A GAME!! 10,12|12,10|9,10|10,9|8,9|9,8|7,8|8,7|4,7|7,4|13,4|4,13|6,13|13,6|'; echo preg_replace('([^A-Za-z0-9-,|]+)','',$string); try... Quote Link to comment Share on other sites More sharing options...
Kingy Posted November 12, 2007 Author Share Posted November 12, 2007 ok Cleans it up in a limited way , | , | , | , | , | , | , | , | , | , | , | , | 0, | , 0| , 0| 0, | , 0, Welcome To YAHTZEE Type Help For More Info AND HAVE A GAME 0, | , 0| , 0| 0, | , | , | , | , | , | , | , | , | , | , | thats what it looks like now Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 12, 2007 Share Posted November 12, 2007 I think you might want to inclulde any legit special charcter like !@#$%^&*()-_+=|\}{[]?><,./ also as it is legit to use said characters, use a pattern more inclusive 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.