Forum Moderators: coopster

Message Too Old, No Replies

How to put %20 as replacement for a single space?

         

irock

9:44 pm on Oct 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have this URL full of XML data ready for parsing.
[mysite.com...]

However, it returns an error saying fopen is failed.
Warning: fopen("http://xxxx/bin/findwhat.dll?getresults&df=1&base=0&mt=cdr media&dc=3&aff_id=47388&ip_addr=24.78.151.93", "r") -

I believe it could be due to the space between 'cdr' and 'media.' So, I was thinking how to eliminate the space by adding %20 automatically. Is there a function to do this kind of task?

Thanks in advance.

jarboy

9:54 pm on Oct 15, 2002 (gmt 0)

10+ Year Member



[php.net...]

dingman

9:55 pm on Oct 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Assuming you're still using PHP, try urlencode()

This and many other wonderful things can be found at [php.net ]. It's so good I didn't bother getting a book until I found myself between internet connections for an extended period while Ameritech tried to figure out whether or not they were ever going to record my order for DSL at the new appartment, much less fulfill it. The one I did buy, and even still look at now and again, is Programming PHP by Rasmus Lerdorf & Kevin Tatroe, from O'Reilly. No affiliation.