php file_get_contents and &

Posted by Patrick on Stack Overflow See other posts from Stack Overflow or by Patrick
Published on 2010-04-17T02:09:54Z Indexed on 2010/04/19 2:33 UTC
Read the original article Hit count: 218

Filed under:

Hello all,

I'm trying to use php's file_get_content('a url');

The thing is if the url has '&' in it, for example

file_get_contents('http://www.google.com/?var1=1&var2=2')

it automatically make a requests to www.google.com/?var1=1&amp<no space here>;var2=2

How do I prevent that from happening?

© Stack Overflow or respective owner

Related posts about php