dongpao1926 2011-02-09 14:58
浏览 25


hey guys, i'm completely new to cURL - i've never used it before. If i paste the following two lines inside of my sidebar ...

    $objCUrl = curl_init("");

...i get two divs and a table inserted into my page. Is there a method where i can kind of inspect everything that gets loaded with this curl_init function? I just want to get specific stuff on my page inserted and not everything? E.g. i only want to insert the table but not the two divs that get inserted into my page.

I know i could simply hide them with css, but i'm just curious.

  • 写回答

2条回答 默认 最新

  • dongxian6715 2011-02-09 15:01

    Save the result to a string instead of outputting it.

    $url = '';
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HEADER, false);
    $str = curl_exec($curl);

    Now you can pull whatever you need out of $str and display that.

    First place you should go is the documentation for how to use a function/library.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?



  • ¥15 关于#ar#的问题:/* User can add his own implementation to report the HAL error return state */(语言-c语言)
  • ¥15 ImportError: DLL load failed while importing _iterative: 找不到指定的模块。
  • ¥15 如何通过交互分析得出某高危患者对放疗获益更多
  • ¥15 相关性分析中,p<0.05, r=0.29,怎么评价相关性呢
  • ¥15 docker部署Mongodb后输入命令报错?
  • ¥15 将下列流程图转变成python程序代码
  • ¥15 我需要全国每个城市的最新小区名字等数据。
  • ¥15 开发一个小区生态的小程序
  • ¥15 如何解决Excel中dependent dropdown list 的问题
  • ¥15 MddBootstrapInitialize2失败