Annotation of embedaddon/php/ext/standard/tests/strings/strip_tags_variation8.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test strip_tags() function : usage variations - valid value for 'str' and invalid values for 'allowable_tags'
3: --INI--
4: short_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:
16: echo "*** 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;
33: foreach($quotes as $string_value)
34: {
35: echo "-- Iteration $iterator --\n";
36: var_dump( strip_tags($strings, $string_value) );
37: $iterator++;
38: }
39:
40: echo "Done";
41: --EXPECTF--
42: *** Testing strip_tags() : usage variations ***
43: -- Iteration 1 --
44: string(33) "hello world... strip_tags_test"
45: -- Iteration 2 --
46: string(33) "hello world... strip_tags_test"
47: -- Iteration 3 --
48: string(33) "hello world... strip_tags_test"
49: -- Iteration 4 --
50: string(33) "hello world... strip_tags_test"
51: -- Iteration 5 --
52: string(33) "hello world... strip_tags_test"
53: -- Iteration 6 --
54: string(33) "hello world... strip_tags_test"
55: -- Iteration 7 --
56: string(46) "<html>hello</html> world... strip_tags_test"
57: -- Iteration 8 --
58: string(46) "<html>hello</html> world... strip_tags_test"
59: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>