<?php $text = 'Random -text! and a japanese word アオサギ and one with many pppppss';$text1 = preg_replace('/[^\p{L} ]/u', ' ', $text) . " <= Removes diacritics" . PHP_EOL;echo $text1;$text2 = preg_replace('/[^\p{L}\p{M} ]/u', ' ', $text) . " <= Keeps diacritics" ;echo $text2;
Standard input is empty
Random text and a japanese word アオサギ and one with many pppppss <= Removes diacritics Random text and a japanese word アオサギ and one with many pppppss <= Keeps diacritics
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!