Hello I want to grab some text of a site and i wonder How could i do this in a good way ? i only want some specific text from maybe 1-5 lines in their code with the html stripped, someone that could help me here and show and example on how this can be done ?
You could maybe try cURL $url = "http://someDomain.com"; $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5); curl_setopt ($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, TRUE); $data = curl_exec($ch); curl_close($ch); return $data; PHP: Now the variable $data holds the full page html, next you could use something like preg_match() to find what your looking for and return that as a $text = $match[0]. If you post here or PM me with a url and the text you want, I can put together something for you.