Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Small Str_Replace Problem
01-06-2010, 08:02 PM #1
- Join Date
- Apr 2009
- Thanked 0 Times in 0 Posts
Small Str_Replace Problem
I am trying to send a URL to a webpage like the following:
This I have got working fine but when there are additional variables in the second URL this is when problems occur, E.g.
So Instead of doing it like this (I am the original person that sends the URL data in the URL) I have changed it so that I search and replace all &'s with ;'s before it is sent with the following:
$url = $subfetch['link'];
$url = str_replace("&",";",$url);
But for some reason it is not replacing the & symbols. I can see in my browser that the next page says:
Instead of replacing the &'s with ;'s.
Can anyone see what I am doing wrong here or know of an alternative way to obtain a URL from a URL like this?
01-06-2010, 08:09 PM #2
- Join Date
- Dec 2004
- In a place far, far away...
- Thanked 1,043 Times in 1,019 Posts
You are going about this the wrong way. I suggest that you use urlencode to encode the url so the url query string goes through fine then whatever site you need to get the url variable from just use urldecode.
Users who have thanked _Aerospace_Eng_ for this post: