Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Problem next_posts_link() in P2 integration attempt


peterverkooijen
Participant

@peterverkooijen

This works to remove doubles from a URL:

$string = "http://website.com/blogname/blogname/page/2/";
$string = preg_replace("/([,.?!])/"," \\1",$string);
$parts = explode("/",$string);
$unique = array_unique($parts);
$unique = implode("/",$unique);
$unique = preg_replace("/\s([,.?!])/","\\1",$unique);
echo $unique;

This outputs:

http://website.com/blogname/page/2

:-)

Now I have to turn it into a function…

Skip to toolbar