apw Posted July 15, 2012 Share Posted July 15, 2012 Hello I had 2 questions that maybe someone can help me with. My first question is about restricting certin names when someone registers on my website such as admin or guest. However I may get the occasional person who may try names such as admin2 or guest2. How do I setup some sort of restriction that not only blocks names such as admin or guest but also any other names that may have the word admin or guest in the name? My second question is about adding commas in numbers over 999. My script looks very funny with numbers over 999 that have no comma in them. How would you do this? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/265688-questions-for-the-pros/ Share on other sites More sharing options...
smoseley Posted July 15, 2012 Share Posted July 15, 2012 1. if (preg_match("/.*(admin|guest).*/", $username)) { /* do something */ } 2. $formatted_number = number_format(123456.789, 2); // outputs 123,456.79 Quote Link to comment https://forums.phpfreaks.com/topic/265688-questions-for-the-pros/#findComment-1361588 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.