Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

stripinput

This function will strip the string provided as $text from all HTML symbols, making it into plain text.

stripinput

Quote

stripinput ( mixed $text )


Parameters
text
Mixed subject to be stripped, this can be a string, numeric or an array.

Return Values
The given string decoded as non HTML text

Example
Code
<?php
$text = "<a href='www.example.com'><strong>Here is a site</strong></a>";
 
echo stripinput($text);
?>

Here we will prevent the text to be stored as HTML

Output from the example above

Quote

&lt;a href='www.example.com'&gt;&lt;strong&gt;Here is a site&lt;/strong&gt;&lt;/a&gt;


Changelog
7.01.00 - stripinput() will now also strip arrays

Notes
Using this on entries to the database which is supposed to be HTML will make the HTML to malfunction.
Use this for all submitted entries to the database to prevent injections.


See also …


References