I have a link in format like
I want to to convert it to
http://cache.example.com/a/b.swf
How can I do it?
I tried it with PHP's explode()
function but when I explode some part of string, then I add it to itself it does not work.
I have a link in format like I want to to convert it to http://cache.example.com/a/b.swf How can I do it? I tried it with PHP's |
||||
add comment |
|
|||
|
? |
|||||||||||||
|
If you want to be more "professional", then use a special function http://php.net/manual/en/function.parse-url.php to parse URL. |
|||
|
Try str_replace:
|
|||
|
explode()
urls, rather use function parse_url(). – Glavić Sep 29 '13 at 21:50