by 0x0 · 13y ago · 0 comments
is_numeric('١٣٦٨') // -> false
preg_match('/\d/', '١٣٦٨') // -> no match / false
filter_var('١٣٦٨', FILTER_VALIDATE_INT) // -> false
Which I'm thankful for. I should hope that most people understand base-10 and ascii numbers. I don't want to have to worry about properly validating/handling unicode characters with number parsing. var_dump(preg_match('/\d/u', '١٣٦٨')) -> 1
var_dump(preg_match('/\d/', '١٣٦٨')) -> 0