--TEST-- Test strip_tags() function : usage variations - invalid values for 'str' and 'allowable_tags' --INI-- short_open_tag = on --FILE-- hello \t\tworld... strip_tags_test", 'hello \t\tworld... strip_tags_test', "<%?php hello\t world?%>", '<%?php hello\t world?%>', "<>hello<>", '<>hello<>', "HtMl text", 'HtMl text', "I am not a valid html text", 'I am not a valid html text', "I am a quoted (\") string with special chars like \$,\!,\@,\%,\&", 'I am a quoted (\") string with special chars like \$,\!,\@,\%,\&', ); $quotes = "<%?<>"; //loop through the various elements of strings array to test strip_tags() functionality $iterator = 1; foreach($strings as $string_value) { echo "-- Iteration $iterator --\n"; var_dump( strip_tags($string_value, $quotes) ); $iterator++; } echo "Done"; ?> --EXPECTF-- *** Testing strip_tags() : usage variations *** -- Iteration 1 -- string(43) "hello world... strip_tags_test" -- Iteration 2 -- string(45) "hello \t\tworld... strip_tags_test" -- Iteration 3 -- string(0) "" -- Iteration 4 -- string(0) "" -- Iteration 5 -- string(18) "hello" -- Iteration 6 -- string(18) "hello" -- Iteration 7 -- string(9) "HtMl text" -- Iteration 8 -- string(9) "HtMl text" -- Iteration 9 -- string(37) "I am not a valid html text" -- Iteration 10 -- string(37) "I am not a valid html text" -- Iteration 11 -- string(73) "I am a quoted (") string with special chars like $,\!,\@,\%,\&" -- Iteration 12 -- string(75) "I am a quoted (\") string with special chars like \$,\!,\@,\%,\&" Done