noTagsOrSpecial() public static method

This will utilize the PHP Filter extension if available
public static noTagsOrSpecial ( mixed $value ) : array | mixed | string
$value mixed
return array | mixed | string @mixed
echo "</pre>\n";
?>


<h2>Inspekt::noTags($d)</h2>
<?php 
$newd = Inspekt::noTags($d);
echo "<pre>";
var_dump($newd);
echo "</pre>\n";
?>


<h2>Inspekt::noTagsOrSpecial($d)</h2>
<?php 
$newd = Inspekt::noTagsOrSpecial($d);
echo "<pre>";
var_dump($newd);
echo "</pre>\n";
?>


<h2>Inspekt::getDigits($d)</h2>
<?php 
$newd = Inspekt::getDigits($d);
echo "<pre>";
var_dump($newd);
echo "</pre>\n";
?>

Example #2
0
 /**
  * What might look like blank spaces below are mostly low ASCII chars
  */
 public function testNoTagsOrSpecial()
 {
     $input = '    <SCRIPT<strong>>alert(\'foobar\');<</strong>/SCRIPT>';
     $expect = '&#21;&#21;&#21;&#21;&#21;&#21;&#22; &#22; &#22; &#22; alert(&#039;foobar&#039;);';
     $this->assertSame($expect, Inspekt::noTagsOrSpecial($input));
 }