Need Help Get Text Using CURL

by Dolpet
4 replies
Hello all Warrior,
Can you help me ow to get content list from my web ?
please check this result :
Code:
http://linevin.com/db/curl.php
this for content :
Code:
http://linevin.com/db/data.txt
I need result like this :
Code:
http://domain1.com
http://domain2.com
http://domain3.com
http://domain4.com
This my php file :
PHP Code:
<?php
function bacaHTML($url){
     
$data curl_init();
     
curl_setopt($dataCURLOPT_RETURNTRANSFER1);
     
curl_setopt($dataCURLOPT_URL$url);
     
$hasil curl_exec($data);
     
curl_close($data);
     return 
$hasil;
}

$kodeHTML =  bacaHTML('http://linevin.com/db/data.txt');
$pecah explode("<C01>"$kodeHTML);
$pecahLagi explode('</C01>'$pecah[1]);
foreach (
$pecah as $key => $pecah) {
echo 
$pecahLagi[0];
echo 
'<br/>';
}
?>
Thanks
#curl #text
  • Profile picture of the author phpg
    $kodeHTML = bacaHTML('http://linevin.com/db/data.txt');
    preg_match_all("/https?:\/\/[^<]+/", $kodeHTML, $pecah, PREG_SET_ORDER);
    foreach ($pecah as $pecah0) {
    echo $pecah0[0];
    echo '<br/>';
    }
    {{ DiscussionBoard.errors[8265918].message }}
  • Thats strange I'll look into it now for you.

    are you files even uploaded correctly?
    Signature
    WebDevelopmentGroup NYC & CA- Small Business Web Development, App Development, WordPress Development, Graphic Designs, Online Marketing, Local Marketing & more!. "Call us 1.800.219.1314 or message us!". Visit us today! "Now On Live Chat Mon-Fri.". www.WebDevelopmentGroup.org
    (Whitelable our Services)
    ===================================
    ==> #1 OFFLINE MARKETING FORUM ON THE WEB! <==
    www.OFFLINEMARKETINGFORUM.com
    (Register Now)
    {{ DiscussionBoard.errors[8265959].message }}
  • Profile picture of the author phpg
    Nothing strange there, the code is wrong, it just repeats the first match $pecahLagi[0] over and over.
    {{ DiscussionBoard.errors[8266026].message }}
    • Profile picture of the author Dolpet
      Originally Posted by WebdevelopmentGroup View Post

      Thats strange I'll look into it now for you.
      are you files even uploaded correctly?
      i think this from my code..
      Originally Posted by phpg View Post

      Nothing strange there, the code is wrong, it just repeats the first match over and over.
      thanks for your code my friend..
      working great..

      solved........
      {{ DiscussionBoard.errors[8267003].message }}

Trending Topics