Created
August 6, 2011 15:35
-
-
Save m4rw3r/1129436 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 | |
function($url) | |
{ | |
$matches = array(); | |
if(isset($url[0]) && $url[0] == "/") | |
{ | |
if(isset($url[1]) && $url[1] == "t") | |
{ | |
if(isset($url[2]) && $url[2] == "e" && isset($url[3]) && $url[3] == "a" && isset($url[4]) && $url[4] == "m") | |
{ | |
return array(array(1), $matches); | |
} | |
} | |
if(isset($url[1]) && $url[1] == "m") | |
{ | |
if(isset($url[2]) && $url[2] == "a" && isset($url[3]) && $url[3] == "p" && isset($url[4]) && $url[4] == "-") | |
{ | |
if(isset($url[5]) && $url[5] == "p") | |
{ | |
if(isset($url[6]) && $url[6] == "o" && isset($url[7]) && $url[7] == "o" && isset($url[8]) && $url[8] == "l") | |
{ | |
return array(array(2), $matches); | |
} | |
} | |
if(isset($url[5]) && $url[5] == "d") | |
{ | |
if(isset($url[6]) && $url[6] == "i" && isset($url[7]) && $url[7] == "s" && isset($url[8]) && $url[8] == "c" && isset($url[9]) && $url[9] == "u" && isset($url[10]) && $url[10] == "s" && isset($url[11]) && $url[11] == "s" && isset($url[12]) && $url[12] == "i" && isset($url[13]) && $url[13] == "o" && isset($url[14]) && $url[14] == "n" && isset($url[15]) && $url[15] == "s") | |
{ | |
return array(array(3), $matches); | |
} | |
} | |
} | |
} | |
return array(array(0, 4, 5, 6, 7), $matches); | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment