Skip to content

Instantly share code, notes, and snippets.

@m4rw3r m4rw3r/gist:1129436
Created Aug 6, 2011

Embed
What would you like to do?
<?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
You can’t perform that action at this time.