← All built-ins / strip_tags()

strip_tags()

strip_tags(...$args): string

Parameters

NameTypeDescription
$sstringHTML string
$allowedstringtags to keep, e.g. "<b><i>"optional

Return value

The text without HTML tags.

Example

echo strip_tags("<p>holy <b>php</b></p>");
holy php

See also

htmlspecialchars()htmlentities()