This function remove non alphanumeric characters from a given string. This function works great in apache and Ubuntu terminal if i send standard English strings to process. But if i send a string like "VÈLOCATION" its only works in apache.
<?php
function custome_repalce($newname) {
$newname = preg_replace('~[^\p{L}\p{N}]++~u', '', $newname);
return $newname;
}
echo custome_repalce("VÈLOCATION");
in browser this shows
VÈLOCATION
but when i run his on ubuntu terminal i get a empty string