1--TEST-- 2Test strip_tags() function : usage variations - valid value for 'str' and invalid values for 'allowable_tags' 3--INI-- 4short_open_tag = on 5--FILE-- 6<?php 7/* Prototype : string strip_tags(string $str [, string $allowable_tags]) 8 * Description: Strips HTML and PHP tags from a string 9 * Source code: ext/standard/string.c 10*/ 11 12/* 13 * testing functionality of strip_tags() by giving valid value for $str and invalid values for $allowable_tags argument 14*/ 15 16echo "*** Testing strip_tags() : usage variations ***\n"; 17 18$strings = "<html>hello</html> \tworld... <p>strip_tags_test\v\f</p><?php hello\t wo\rrld?>"; 19 20$quotes = array ( 21 "<nnn>", 22 '<nnn>', 23 "<abc>", 24 '<abc>', 25 "<%?php", 26 '<%?php', 27 "<<html>>", 28 '<<html>>' 29); 30 31//loop through the various elements of strings array to test strip_tags() functionality 32$iterator = 1; 33foreach($quotes as $string_value) 34{ 35 echo "-- Iteration $iterator --\n"; 36 var_dump( strip_tags($strings, $string_value) ); 37 $iterator++; 38} 39 40echo "Done"; 41--EXPECTF-- 42*** Testing strip_tags() : usage variations *** 43-- Iteration 1 -- 44string(33) "hello world... strip_tags_test" 45-- Iteration 2 -- 46string(33) "hello world... strip_tags_test" 47-- Iteration 3 -- 48string(33) "hello world... strip_tags_test" 49-- Iteration 4 -- 50string(33) "hello world... strip_tags_test" 51-- Iteration 5 -- 52string(33) "hello world... strip_tags_test" 53-- Iteration 6 -- 54string(33) "hello world... strip_tags_test" 55-- Iteration 7 -- 56string(46) "<html>hello</html> world... strip_tags_test" 57-- Iteration 8 -- 58string(46) "<html>hello</html> world... strip_tags_test" 59Done 60