I'm working with Zend Framework. I want to check last part of link. my link is http://localhost/sports/soccer/page_id/776543233242
my last part of URL must have 12 or 11 digit , and I want first of that part start with 8 if 11 digit and start with 7 if 12 digit.
public function detailAction ()
{
$uri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
if (substr(substr($uri, -12),1)=='7'){
echo "successfull";
}
else if (substr(substr ($uri , -11),8)=='0'){
echo "succ";
}
else {
echo "failed";
}
}