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

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -