Friday, 23 August 2013

php explode to get last integer from url

php explode to get last integer from url

i am trying to get the last integer in the url i am using php explode
which gives the last value after / but i dont know how to get the last
integer just before the /
my url is
http://way2enjoy.com/touch/w2et/quotesalphalist.php?page=124/ABCD
i am interested in getting 124 from the above url.
i can get the last value ABCD with the below explode code but dont know
how to get 124
$c=explode("/",$_SERVER[ 'REQUEST_URI' ]); $city=end($c);
please suggest how to get 124 like integer from the above url.please note
that this 124 ma y change to any number but it will be always number and
just before last /

No comments:

Post a Comment