How can I only take the alphanumeric text and spaces from a given text.
I can do the regex and I have come up with -> [A-Za-z0-9 ]+ but I dont know any functions in php which will take the text and apply th开发者_StackOverflow中文版at rule and return me the match.
You can use the preg_grep function. See the PHP documentation for details.
mixed preg_replace ( mixed $pattern , mixed $replacement , mixed $subject [, int $limit = -1 [, int &$count ]] )
(source: http://www.php.net/manual/en/function.preg-replace.php)
What about doing a little bit of research before asking questions?
精彩评论