Results 1 to 1 of 1
-
11th Aug 2012, 06:08 PM #1OPMember
Simplex PHP filter function
Hello,
I dont know about you but for me if their is an easy and shorter way of coding in PHP then i will se it. To day i made a small filter function (untested)
PHP Code:<?php
/**
* @authors Jordan Hall <nukezilla@hotmail.co.uk> & JokerHacker
* @Acknowledge S.C. Chen <http://sourceforge.net/projects/simplehtmldom/>
* @Contributions Bennett Treptow <Upload class>
* @SpecailThanks Bennett Treptow for teching me Comparison Operators
* @version 0.1
* @copyright 2012 Sim*****HP
*/
function filter ($type, $input, $min = null, $max = null)
{
$type = strtolower($type);
if ($type == "string")
{
if($min == null && $max == null){
{
return (filter_var($input, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH)) ? $input:false;
else
{
if (strlen($input) < $min || (strlen($input) > $max )
{
return false;
}
else
{
return $input;
}
}
}
elseif ($type == "int")
{
return (filter_var($input, FILTER_SANITIZE_NUMBER_INT)) ? $input:false;
}
elseif ($type == "url")
{
return (filter_var($input, FILTER_SANITIZE_URL)) ? $input:false;
}
elseif ($type == "ip")
{
if (filter_var($input, FILTER_VALIDATE_IP)) ? $input:false;
}
elseif ($type == "email")
{
if (filter_var($input, FILTER_SANITIZE_EMAIL)) ? $input:false;
}
}
?>
?>
Jordanxifyhosting Reviewed by xifyhosting on . Simplex PHP filter function Hello, I dont know about you but for me if their is an easy and shorter way of coding in PHP then i will se it. To day i made a small filter function (untested) <?php /** * @authors Jordan Hall <nukezilla@hotmail.co.uk> & JokerHacker * @Acknowledge S.C. Chen <http://sourceforge.net/projects/simplehtmldom/> * @Contributions Bennett Treptow <Upload class> Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Simplex Password encrypter Beta
By xifyhosting in forum Web Development AreaReplies: 5Last Post: 10th Aug 2012, 12:45 PM -
Simplex PHP
By xifyhosting in forum Web Development AreaReplies: 0Last Post: 9th Aug 2012, 05:11 PM -
[IPB] Bad words Filter
By immu in forum Webmaster ResourcesReplies: 0Last Post: 9th Jun 2012, 04:30 AM -
Avoiding the spam filter?
By Jesse in forum Webmaster DiscussionReplies: 6Last Post: 27th Dec 2010, 01:25 PM
themaCreator - create posts from...
Version 3.24 released. Open older version (or...