Untitled

mail@pastecode.io avatar
unknown
php
a year ago
2.7 kB
2
Indexable
Never
<?php 
// turkce kucuk karakterler
function latin1($a) {
$array1=array('ç','Ç','ð','Ð','ý','Ý','ö','Ö','þ','Þ','ü','Ü');
$array2=array('c','c','g','g','i','i','o','o','s','s','u','u');
return replace($array1,$array2,lower($a));
}

function makeURL($text) {
$array1=array('&lt;','&quot;','&#39;','&#92;','%',' ');
$array2=array('','','','','','_');
$text=replace($array1,$array2,lower($text));
//echo $text.'<br/>';

$array=array('a','b','c','ç','d','e','f','g','ð','h','ý','i','j','k','l','m','n','o','ö','p','q','r','s','þ','t','u','ü','v','w','x','y','z',1,2,3,4,5,6,7,8,9,0);
$total=strlen($text);
for ($i=1; $i<$total; $i++) {
$string=substr($text,($i-1),1);
if (in_array($string,$array)) $output.=$string;
}
//echo $output.'<br/><br><br>';
return replace($array1,$array2,lower($output));
}

// duz metin olusturma fonksiyonu
function plain($txt) { return str_replace(array("<","\\'"),array("&lt;","'"),$txt); }
function strip($text) { return str_replace(array('<','"','\'','\\'),array('&lt;','&quot;','&#39;','&#92;'),stripslashes(trim($text))); }
function jStrip($text) { return str_replace(array('<','"','\''),array('&lt;','&quot;','&#39;'),trim($text)); }

function validNick($nick) {
$a=array('a','b','c','ç','d','e','f','g','ð','h','ý','i','j','k','l','m','n','o','ö','p','q','r','s','þ','t','u','ü','v','w','x','y','z','_','-',' ','*','!','^','?','.',',',';','&','+','%','/','(',')','=','{','}',':','|','<','>','"',"'",);
$t=strlen($nick);
for ($i=0; $i<$t; $i++) {
if (!in_array(substr($nick,$i,1),$a)) return FALSE;
}
return TRUE;
}
function runAJAX($word) {
$a=array('Ãœ','Å&#158;','Ä&#158;','Ç','Ä°','Ö','ü','ÅŸ','ç','ı','ö','ÄŸ');
$b=array('Ü','Þ','Ð','Ç','Ý','Ö','ü','þ','ç','ý','ö','ð');

return str_replace($b,$a,$word);
}

function nick($nick,$wrap=1) {
$a=array('<',"\\'",'&');
$b=array('&lt;',"'",'&amp;');

$nick=str_replace($a,$b,stripslashes($nick));

if ($wrap==0) return $nick;

return wordwrap($nick,15,'<br/>'.CRLF,1);
}

function rep($a,$b,$c) { return str_replace($a,$b,$c); }
function replace($a,$b,$c) { return str_replace($a,$b,$c); }
function remove($a,$b) { return str_replace($a,NULL,$b); }
function erep($a,$b,$c) { return eregi_replace($a,$b,$c); }

// turk isi strtolower
function lower($a) {
$array1=array('I','Ç','?','?','Ö','?','Ü');
$array2=array('?','ç','?','i','ö','?','ü');
$a=replace($array1,$array2,$a);
return strtolower($a);
}

function makeCode($code) {
echo str_replace(array('<','>','&','"','\'','[',']'),array('&lt;','&gt;','&amp;','&quot;','&#39;','&#91;','&#93;'),$code);
}

function sql($text) {
return mysql_real_escape_string($text);
}
?>