- var_dump: documentation ( source)
- preg_match: documentation ( source)
<?php
var_dump(preg_match('[0-9a-zA-Z]', 'bob', $matches), $matches);
echo '---------', PHP_EOL;
var_dump(preg_match('~[0-9a-zA-Z]~', 'bob', $matches), $matches);
echo '---------', PHP_EOL;
var_dump(preg_match('~[0-9a-zA-Z]+~', 'bob', $matches), $matches);