Created
January 14, 2017 12:09
-
-
Save muhammedzaimtr/fa0cde0a8e76b0c92f65a90cc811a6d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by Muhammed ZAİM | |
* mail: info@muhammedzaim.com | |
* web: muhammedzaim.com | |
* github: @muhammedzaimtr | |
* twitter: @muhammedzaimtr | |
*/ | |
class BasicSefLink | |
{ | |
function basicselflink($zaim) { | |
$turk = array('ş','Ş','ı','I','İ','ğ','Ğ','ü','Ü','ö','Ö','Ç','ç','(',')','/',':',','); | |
$eng = array('s','s','i','i','i','g','g','u','u','o','o','c','c','','','-','-',''); | |
$zaim = str_replace($turk,$eng,$zaim); | |
$zaim = strtolower($zaim); | |
$zaim = preg_replace('/&amp;amp;amp;amp;amp;amp;amp;amp;.+?;/', '', $zaim); | |
$zaim = preg_replace('/\s+/', '-', $zaim); | |
$zaim = preg_replace('|-+|', '-', $zaim); | |
$zaim = preg_replace('/#/', '', $zaim); | |
$zaim = str_replace('.', '', $zaim); | |
$zaim = trim($zaim, '-'); | |
return $zaim; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment