PHPBuilder - PHP Filters: An Important Security Feature Page 3



RSS Twitter
Articles Application Architecture

PHP Filters: An Important Security Feature - Page 3

by: PHP Builder Staff
|
October 1, 2009

But there's more. Let's run through a few things. Need to remove HTML tags from a string. How about this?
<?php

$string = "<p>text</p>";

echo filter_var($string, FILTER_SANITIZE_STRING);

?>
The result is that it will simply echo "text" without the tags.
Conclusion
What we have looked at here are a few examples of what we can do with PHP FILTERS. Of course it is important to validate your code--we ALL know that. But actually doing it is another story. I suppose thart this just gives you, the coder, whether you are a novice or an expert--a way of being sure something is being done to help your code in its journey from bad coding to good coding. May your code be the best that it can be!
Until next time,

Marc Steven Plotz

« Previous Page
1
|
2
|
3

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:

Comment:



Comment:

(Maximum characters: 1200). You have characters left.