I'm trying to replace the value of Ñ in a preg_replace. I have this code:
<?php
$name = 'AVENDAÑO, PAULVIC T.';
$match = preg_replace('/[^A-Z]/','N',$name);
echo '<pre>';
print_r($match);
echo '</pre>';
?>
Though variable $name holds AVENDAÑO, PAULVIC T. Still it displays AVENDAÑO, PAULVIC T.
But when I try to use the code above it replaces all non-characters to N.
I know there's something wrong with my regex or does anyone knows any alternative to solve these problem regarding character formatting?