- var_dump: documentation ( source)
- preg_match: documentation ( source)
<?php
$pattern = "/[^:alpha:0-9_\s\'-]/i";
preg_match($pattern, "test#dsd", $matches);
var_dump($matches);
preg_match($pattern, "ajedrez español", $matches2);
var_dump($matches2);
preg_match($pattern, "my clúb", $matches3);
var_dump($matches3);