permalink

  1. if(!class_exists(permalink)) {

  2.         class permalink {

  3.                 function create($giris,$utf8=false)

  4.                 {

  5.                         if($utf8) $giris =mb_convert_encoding($giris,‘ISO-8859-′,‘UTF-8′);

  6.                        

  7.                         $giris = preg_replace(“/\s+/”,“-”,$giris);                 

  8.                         $giris = urlencode($giris);

  9.                         $tr1=array(‘/%E7/’,‘/%C7/’,‘/%FD/’,‘/%DD/’,‘/%F0/’,‘/%D0/’,‘/%F6/’,‘/%D6/’,‘/%FE/’,‘/%DE/’,‘/%FC/’,‘/%DC/’);

  10.                         $tr2=array(‘c’,‘C’,‘i’,‘I’,‘g’,‘G’,‘o’,‘O’,’s’,‘S’,‘u’,‘U’);

  11.                         $a =preg_replace($tr1,$tr2,$giris);

  12.                        

  13.                         $illegal = array(‘&’,‘@’,‘{’,‘}’,‘[’,‘]’,‘?’,\\,‘/’,‘!’,‘#’,‘$’,‘=’,‘|’,‘,’,‘€’,‘^’,“’”,‘”’,‘%’);

  14.                         $legal = array();

  15.                         foreach($illegal as $il_node) array_push($legal,“”);

  16.                        

  17.                         //özel karakterleri temizle

  18.                         $re =“/\���|\\$|\@|\&|\#|\~|\`|\%|\*|\^|\||\+|\=|\_|\[|\]|\{|\}|\;|\,|\’|\:|\\\”|\<|\>|\?|\!|\��|\\\|\��|\//”;

  19.             $a= preg_replace($re,“”,urldecode($a));

  20.                        

  21.                        

  22.                         if($utf8) $a=mb_convert_encoding($a,‘UTF-8′,‘ISO-8859-9′);

  23.                         return $a;

  24.                

  25.                 }

  26.         }

  27. }

convert this post to pdf.
Etiketler : PHP, ,

1 Response

  1. ismail ata kurt Says:

    bu fonksiyon biyerden tanıdık gelio ama çıkaramadım hehe :P

    Posted on December 18th, 2007 at 17:15

Leave a Reply




*
To prove you're a person (not a spam script), type the answer to the math equation shown in the picture. Click on the picture to hear an audio file of the equation.
Click to hear an audio file of the anti-spam equation