SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Combine variable and url

    hi
    i am trying to do this code but putting my variable in the middle of the url

    file_get_contents("http://www.google.com/search?&q=n93+amazon.com&btnI");

    how do i do this

    thanks

  2. #2
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    file_get_contents("http://www.google.com/search?&q=$yourvar&btnI");
    or
    file_get_contents('http://www.google.com/search?&q='.$yourvar.'&btnI');

    You'll probably need to rawurlencode() $yourvar first (or urlencode)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •