Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Test strip_tags() function : usage variations - single quoted strings --FILE-- <?..

Decoded Output download

*** Testing strip_tags() : usage variations ***
-- Iteration 1 --

Did this file decode correctly?

Original Code

--TEST--
Test strip_tags() function : usage variations - single quoted strings
--FILE--
<?php
/*
 * testing functionality of strip_tags() by giving single quoted strings as values for $str argument
*/

echo "*** Testing strip_tags() : usage variations ***\n";


$single_quote_string = array (
  '<html> \$ -> This represents the dollar sign</html><?php echo hello ?>',
  '<html>\t\r\v The quick brown fo\fx jumped over the lazy dog</p>',
  '<a>This is a hyper text tag</a>',
  '<? <html>hello world\\t</html>?>',
  '<p>This is a paragraph</p>',
  '<b>This is \ta text in bold letters\r\s\malong with slashes\n</b>'
);

$quotes = "<html><a><p><b><?php";

//loop through the various elements of strings array to test strip_tags() functionality
$iterator = 1;
foreach($single_quote_string as $string_value)
{
      echo "-- Iteration $iterator --\n";
      var_dump( strip_tags($string_value, $quotes) );
      $iterator++;
}

echo "Done";
?>
--EXPECT--
*** Testing strip_tags() : usage variations ***
-- Iteration 1 --
string(51) "<html> \$ -> This represents the dollar sign</html>"
-- Iteration 2 --
string(63) "<html>\t\r\v The quick brown fo\fx jumped over the lazy dog</p>"
-- Iteration 3 --
string(31) "<a>This is a hyper text tag</a>"
-- Iteration 4 --
string(0) ""
-- Iteration 5 --
string(26) "<p>This is a paragraph</p>"
-- Iteration 6 --
string(65) "<b>This is \ta text in bold letters\r\s\malong with slashes\n</b>"
Done

Function Calls

strip_tags 1

Variables

$quotes <html><a><p><b><?php
$iterator 1
$string_value <html> \$ -> This represents the dollar sign</html><?php ech..
$single_quote_string [{'key': 0, 'value': '<html> \\$ -> This represents the dollar sign</html><?php echo hello ?>'}, {'key': 1, 'value': '<html>\\t\\r\\v The quick brown fo\\fx jumped over the lazy dog</p>'}, {'key': 2, 'value': '<a>This is a hyper text tag</a>'}, {'key': 3, 'value': '<? <html>hello world\\t</html>?>'}, {'key': 4, 'value': '<p>This is a paragraph</p>'}, {'key': 5, 'value': '<b>This is \\ta text in bold letters\\r\\s\\malong with slashes\\n</b>'}]

Stats

MD5 2601dd6c6ef6f164f1bb9f71e4a6ea64
Eval Count 0
Decode Time 96 ms