earthman
01-12-2007, 12:35 PM
hi all,
Say i pull a large text from a database that i have called $code.
$code contains the source code from any random web page that i have got hold of using this script:
<?php
$code = file_get_contents("http://www.bbc.co.uk/");
?>
I want to then take $code and get rid of all the HTML and other tags etc, and leave me with all the text in there. To put it another way i want to get all the text out of $code and save it as $text.
How do i do this?
How do i select text that lies between to words, strings, or tags?
Cheers
Say i pull a large text from a database that i have called $code.
$code contains the source code from any random web page that i have got hold of using this script:
<?php
$code = file_get_contents("http://www.bbc.co.uk/");
?>
I want to then take $code and get rid of all the HTML and other tags etc, and leave me with all the text in there. To put it another way i want to get all the text out of $code and save it as $text.
How do i do this?
How do i select text that lies between to words, strings, or tags?
Cheers