I need to extract the value of \"page\" i.e 5 from this url - http://snypher.local/photos/page/5 What should I do to extract it in Wordpress? I am not able to get it from th
function get_url_var($name)
{
$strURL = $_SERVER['REQUEST_URI'];
$arrVals = explode("/",$strURL);
$found = 0;
foreach ($arrVals as $index => $value)
{
if($value == $name) $found = $index;
}
$place = $found + 1;
return $arrVals[$place];
}
$page = get_url_var('page');
I have used this function to get the value of the variable page from the url.