3v4l.org

run code in 300+ PHP versions simultaneously
<?php function stripSpecialCharater($string) { $string = iconv("Windows-1252","UTF-8",urldecode($string)); $string = preg_replace(array('/\s{2,}/', '/[\t\n]/'), ' ', $string); return preg_replace('/[^a-zA-Z0-9ç&-©‚ƒ‘\s]/', '', $string); } $tests = ['12 34', 'adsf', 'co©', 'pound £']; foreach ($tests as $test) { echo "$test : " , stripSpecialCharater($test), "\n"; } // & is at ASCII decimal place 38 // © is at ASCII decimal place 169
Output for git.master, git.master_jit, rfc.property-hooks
12 34 : Warning: iconv(): Wrong encoding, conversion from "Windows-1252" to "UTF-8" is not allowed in /in/R1m17 on line 4 adsf : Warning: iconv(): Wrong encoding, conversion from "Windows-1252" to "UTF-8" is not allowed in /in/R1m17 on line 4 co© : Warning: iconv(): Wrong encoding, conversion from "Windows-1252" to "UTF-8" is not allowed in /in/R1m17 on line 4 pound £ : Warning: iconv(): Wrong encoding, conversion from "Windows-1252" to "UTF-8" is not allowed in /in/R1m17 on line 4

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
62.29 ms | 402 KiB | 8 Q