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