public function validate_data( $data = '' , $allowed_patterns = array() , $trim = true , $additional_chars = '' )
{
$patterns = array(
'all' => 'qwertyuopasdfghjklizxcvbnmQWERTYUIOPASDFGHJKLZXCVBNMgüsiöçGÜSIÖÇ 0123456789+?_-{}[]()/#$<>|½/&^!"\\\',;.:~',
'alpha_lower' => 'qwertyuopasdfghjklizxcvbnm',
'alpha_upper' => 'QWERTYUIOPASDFGHJKLZXCVBNM',
'alpha_lower_tr' => 'güsiöç',
'alpha_upper_tr' => 'GÜSIÖÇ',
'space' => ' ',
'numeric' => '0123456789',
'special' => '+?_-{}[]()/#$<>|½/&^!"\\\',;.:~'
);
if(!is_array($allowed_patterns))
return;
if($trim)
$data = trim($data);
if(!$data)
return;
$count = count($allowed_patterns);
$charset = '';
// tdundaralp@gmail.com
for( $t = 0 ; $t < $count ; $t++ )
{
$charset .= $patterns[$allowed_patterns[$t]];
}
$charset .= $additional_chars;
$count = strlen($data);
for($t=0;$t<$count;$t++)
{
if(!strstr($charset,substr($data,$t,1)))
{
return;
}
}
return $data;
}
toygar dündaralp tdundaralp@gmail.com
bahçivan ibrahim sitesi