xxxxxxxxxx
<?php
// 26. html_entity_decode()
$str = "<p>Hello, <b>world</b>!</p>";
echo html_entity_decode($str);
echo "\n";
// Output:
// <p>Hello, <b>world</b>!</p>
// 27. addslashes()
$str = "Hello 'world'!";
echo addslashes($str);
echo "\n";
// Output:
// Hello \'world\'!
// 28. stripslashes()
$str = "Hello \'world\'!";
echo stripslashes($str);
echo "\n";
// Output:
// Hello 'world'!
// 29. htmlspecialchars()
$str = "<p>Hello, <b>world</b>!</p>";
echo htmlspecialchars($str);
echo "\n";
// Output:
// <p>Hello, <b>world</b>!</p>
// 30. sprintf()
$num = 5;
$location = 'tree';
$format = 'There are %d monkeys in the %s';
echo sprintf($format, $num, $location);
echo "\n";
// Output:
// There are 5 monkeys in the tree
?>