I need to parse a URL in php for a facebook like button. what I do now is this:
<?php
echo curPageURL();
?>
but I have articles that are sometimes 2 or three pages long so I want to parse the url without the page number so that the like button is for the first page of the article. Sometimes a page number does not exist either.
my url looks like this http://www.mydomain.com/23/My-Article-Title/2/
the 2 at the end is the page number indicating page 2. page one of the article appears like this though
http://www.mydomain.com/23/My-Article-Title/
how do I parse the url in php to remove the page number if it exists?
so I would only want to parse it if there was a page number.