3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $valid_strings = array("<p>","&nbsp;"); $test1 = '<p>asdasdasdasdasdasdasd</p>'; $test2 = '<p>&nbsp;&nbsp;&nbsp;&nbsp;</p>'; echo ContainsAnythingElseThan($test1,$valid_strings); function ContainsAnythingElseThan($the_string,$the_valid_strings_array) { return count(str_replace($the_string,$the_valid_strings_array,''))!=0; }
based on ZRgqM
Output for 4.3.0 - 5.6.21, 7.0.0 - 7.1.0
Notice: Array to string conversion in /in/aqoGE on line 17 1
Output for hhvm-3.10.0 - 3.12.0
Notice: Array to string conversion in /in/aqoGE on line 17 Notice: Array to string conversion in /in/aqoGE on line 17 1