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