kidwon
kidwon

Reputation: 4524

Ignore html tags when loading page

Is there a simple php script ignoring html content in a database and not loading it using php? Like: don't load images, or anchors, or elements with class=""...

Best Regards

Upvotes: 0

Views: 363

Answers (3)

Mob
Mob

Reputation: 11098

You can strip_tags()

This function tries to return a string with all NUL bytes, HTML and PHP tags stripped from a given str. It uses the same tag stripping state machine as the fgetss() function.

Upvotes: 1

ern0
ern0

Reputation: 3172

I think you're looking for strip_tags(). It removes HTML tags from a text. You can also specify list of tags to keep.

Have to say, parsing text content from a HTML page requires more complex operation.

Upvotes: 1

pinaldesai
pinaldesai

Reputation: 1815

use function strip_tag('your content here'). It will remove all HTML tags from your content and gives pure text base output.

http://php.net/manual/en/function.strip-tags.php

Upvotes: 1

Related Questions