Hi All
I’ve got a reasonable amount of know-how with php now and in my time I’ve seen these sceeeery scripts resembling something the enigma encrypter would churn out (for example, $text = ereg_replace(“[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]”,”<a href=”
Anyway – I find myself in the situation where I’m reading a webpage source code into a string and I need to strip the html tags out of it and leave just the displayable content. I realise I need to use ereg_replace or preg_replace (do I?) but I’m jiggered if I know how to use these expressions and the manuals aren’t much help!
For example if I read this into a string…
[code=html]
<html>
<head>
<title>Something wicked this way comes</title>
</head>
<body>
This is the interesting stuff I want to extract
</body>
</html>
I want to end up with just this:
[code=html]Something wicked this way comes This is the interesting stuff I want to extract
I’d massively appreciate being given the line of code that performs this little piece of magic and if you can explain exactly what it’s doing then I might even pop round and give you a hug ?
Thanks loads already
Sol