I want to modify some $_SERVER[‘QUERY_STRING’]
$_SERVER['QUERY_STRING'] : "http://domain.com/blog/topics/post-name/uploads/flashfile.swf"
I want this output: "http://domain.com/uploads/flashfile.swf"
So, the middle section “blog/topics/post-name/” need to be trimed. The actual words can change depends on which page the query_string is processed, especially the post-name is unpredicable.
How can I trim this middle section?
Edit: the flashfile.swf is just an example, it can be different names with different extention.
The easiest way is,
Here is a dynamic one.