allow alpha_numeric and symbols preg_match php

I have the following function

public function alpha_custom($str)
{
   return ( ! preg_match("/^([-a-z0-9_-])+$/i", $str)) ? FALSE : TRUE;
}

So ,if the string contains anything other than alpha-numeric characters, underscores or dashes then it will return false.

Now i want to add the following

  1. SPACE
  2. &
  3. ( AND )
  4. . (period )

Please help me.
Thanks.

Leave a Reply

*

Hire Me
Follow Me!
Search
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.
Categories