strip_formatting

Text-related functions

Summary

strip_formatting(string $str, string $allowableTags =, string $fallbackStr =)

Strip HTML formatting (i.e. tags) from the provided string.

This is essentially a wrapper around PHP’s strip_tags() function, with theadded benefit of returning a fallback string in case the resulting strippedstring is empty or contains only whitespace.

Parameters:
  • $str (string) – The string to be stripped of HTML formatting.
  • $allowableTags (string) – The string of tags to allow when stripping tags.
  • $fallbackStr (string) – The string to be used as a fallback.
Returns:

The stripped string.

Usage

Examples

See Also

Project Versions

Table Of Contents

Previous topic

snippet_by_word_count

Next topic

text_to_id

This Page