1--TEST--
2Test strip_tags() function : usage variations - double quoted strings
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 double quoted strings as values for $str argument
12*/
13
14echo "*** Testing strip_tags() : usage variations ***\n";
15
16$double_quote_string = array (
17  "<html> \$ -> This represents the dollar sign</html><?php echo hello ?>",
18  "<html>\t\r\v The quick brown fo\fx jumped over the lazy dog</p>",
19  "<a>This is a hyper text tag</a>",
20  "<? <html>hello world\\t</html>?>",
21  "<p>This is a paragraph</p>",
22  "<b>This is \ta text in bold letters\r\s\malong with slashes\n</b>"
23);
24
25$quotes = "<html><a><p><b><?php";
26
27//loop through the various elements of strings array to test strip_tags() functionality
28$iterator = 1;
29foreach($double_quote_string as $string_value)
30{
31      echo "-- Iteration $iterator --\n";
32      var_dump( strip_tags($string_value, $quotes) );
33      $iterator++;
34}
35
36echo "Done";
37--EXPECT--
38*** Testing strip_tags() : usage variations ***
39-- Iteration 1 --
40string(50) "<html> $ -> This represents the dollar sign</html>"
41-- Iteration 2 --
42string(59) "<html>
42 The quick brown fox jumped over the lazy dog</p>"
43-- Iteration 3 --
44string(31) "<a>This is a hyper text tag</a>"
45-- Iteration 4 --
46string(0) ""
47-- Iteration 5 --
48string(26) "<p>This is a paragraph</p>"
49-- Iteration 6 --
50string(62) "<b>This is 	a text in bold letters
50\s\malong with slashes
51</b>"
52Done
53