html - Weird result in php -
why output of code "true" ?
<?php if (preg_match("/^[Ī]+$/", "ê")) { die("true"); } else { die("false"); } ?> the result should false not true!
your strings unicode, if want preg_match work on unicode string should add u modifier:
if (preg_match("/^[Ī]+$/u", "ê")) {
Comments
Post a Comment