PHP使用GET参数从外部URL获取内容

I copied this code from another question here on stack..

   $fbid = '666666666';
    $url = 'http://www.example.de/v/fffff.php'; // work
    $url = 'http://www.example.de/v/fffff.php?fbid=' . $fbid; // not working, page don't load

    curl_setopt_array($curl, array(
      CURLOPT_URL => $url,
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "cache-control: no-cache"
      ),
    ));

    $antwort = curl_exec($curl);
    $err = curl_error($curl);

    curl_close($curl);

Anyone idea how to get the contents from url with GET parameters?

You are missing the . that concatenates $fbid to the url. And you need to instantiate the curl first as well. Change your code to:

        $fbid = 123;// as sample dbid
        $url = 'http://www.example.de/v/fffff.php'; // work
        $url = 'http://www.example.de/v/fffff.php?fbid='.$fbid; // not working, page don't load

        $curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "cache-control: no-cache"
    ),
));

$antwort = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

Hope this helps.