3v4l.org

run code in 200+ 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 7.2.0
Notice: Array to string conversion in /in/aqoGE on line 17 Warning: count(): Parameter must be an array or an object that implements Countable in /in/aqoGE on line 17 1
Output for 4.3.0 - 7.1.10
Notice: Array to string conversion in /in/aqoGE on line 17 1