$output = curl_exec($ch);
bu satırla içeriği output değişkenine aktarıyorsun. ondan sonrası basit zaten

echo $output;