3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "up vote -1 down vote favorite What is the best way to filter characters like this: ็็็็็็็็็็็็็็็็็็ ็็็็็็็"; echo preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $str);

preferences:
25.38 ms | 402 KiB | 5 Q