3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Bla { function Bla() { $data = array('foo' => 'bläa ,.,. blubb'); var_dump($this->_parseResults($data)); } function _parseResults($results) { foreach ($results as $key => $result) { $results[$key] = trim(preg_replace('/[^a-zA-Z0-9-_. ]/', '', $result)); } return $results; } } new Bla();
based on igiTl
Output for 7.0.0 - 7.1.0
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Bla has a deprecated constructor in /in/A9U3a on line 3 array(1) { ["foo"]=> string(12) "bla .. blubb" }
Output for 4.3.0 - 5.6.28
array(1) { ["foo"]=> string(12) "bla .. blubb" }