Forums
-
- Forum
- Posts
-
- Installing BuddyPress
- 24,018
- How-to & Troubleshooting
- 129,639
- Creating & Extending
- 25,793
- Requests & Feedback
- 9,497
- Third Party Plugins
- 9,791
- Showcase
- 3,316
- Ideas
- 1,382
- Miscellaneous
- 9,179
-
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…