1--TEST-- 2Test strip_tags() function : basic functionality - with all arguments 3--FILE-- 4<?php 5echo "*** Testing strip_tags() : basic functionality ***\n"; 6 7// Calling strip_tags() with all possible arguments 8$string = "<html><p>hello</p><b>world</b><a href=\"#fragment\">Other text</a></html><?php echo hello ?>"; 9 10$allowed_tags_array=array( 11 "<html>", 12 '<html>', 13 "<p>", 14 '<p>', 15 "<a>", 16 '<a>', 17 "<?php", 18 '<?php', 19 "<html><p><a><?php" 20); 21 22// loop through the $string with various $allowed_tags_array to test strip_tags 23// on various allowed tags 24$iteration = 1; 25foreach($allowed_tags_array as $tags) 26{ 27 echo "-- Iteration $iteration --\n"; 28 var_dump( strip_tags($string, $tags) ); 29 $iteration++; 30} 31 32echo "Done"; 33?> 34--EXPECT-- 35*** Testing strip_tags() : basic functionality *** 36-- Iteration 1 -- 37string(33) "<html>helloworldOther text</html>" 38-- Iteration 2 -- 39string(33) "<html>helloworldOther text</html>" 40-- Iteration 3 -- 41string(27) "<p>hello</p>worldOther text" 42-- Iteration 4 -- 43string(27) "<p>hello</p>worldOther text" 44-- Iteration 5 -- 45string(44) "helloworld<a href="#fragment">Other text</a>" 46-- Iteration 6 -- 47string(44) "helloworld<a href="#fragment">Other text</a>" 48-- Iteration 7 -- 49string(20) "helloworldOther text" 50-- Iteration 8 -- 51string(20) "helloworldOther text" 52-- Iteration 9 -- 53string(64) "<html><p>hello</p>world<a href="#fragment">Other text</a></html>" 54Done 55