Hey ! Is there any way I can get only the text on the HTML document i open with CURL ? Sort of outertext rather then the innerhtml ! Any help appreciated !
will CURLOPT_TRANSFERTEXT help ? how to use it ? All I want is to get the text of the HTML document ! Strip tag does not remove from javascript !
$text = 'Some HTML'; if (preg_match('~<body[^>]*>(.*?)</body>~si', $text, $body)) { // Strip the naughty stuff $text = preg_replace( array('~[\r\n]+~', '~<(script|object|embed)[^>]*>(?:.*?)</\1>~si'), array(' ', null), $body[1] ); // Strip the rest $text = strip_tags($text); echo $text; } PHP: