- var_dump: documentation ( source)
- preg_match: documentation ( source)
<?php
var_dump(preg_match('/^[0-9]$/', "123"));
var_dump(preg_match('/^[0-9]$/', "\n123\n"));
var_dump(preg_match('/^[0-9]$/m', "123"));
var_dump(preg_match('/^[0-9]$/m', "\n123\n"));