3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $valid_strings = array("<p>","&nbsp;","</p>"); $test1 = '<p>asdasdasdasdasdasdasd</p>'; $test2 = '<p>&nbsp;&nbsp;&nbsp;&nbsp;</p>'; echo ContainsAnythingElseThan($test1,$valid_strings); echo ContainsAnythingElseThan($test2,$valid_strings); function ContainsAnythingElseThan($the_string,$the_valid_strings_array) { return count(str_replace($the_valid_strings_array,'',$the_string))!=0; }
based on tM0VF
Output for 7.2.0
Warning: count(): Parameter must be an array or an object that implements Countable in /in/3P7B6 on line 17 1 Warning: count(): Parameter must be an array or an object that implements Countable in /in/3P7B6 on line 17 1
Output for 4.3.0 - 7.1.10
11