mycred_strip_tags

Codex / mycred/core / Functions / mycred_strip_tags

Navigation:

  1. Description
  2. Usage
  3. Parameters
  4. Example
  5. Return

Description

Strips HTML tags from a given string. Optionally you can overwrite the default allowed tags. By default the following elements are allowed: <a><br><em><strong><span>

 

Usage

<?php echo mycred_strip_tags( $string, $allowed ); ?>

 

Parameters

  • string (string)
    The string to be stripped.
  • param (string)
    Optional HTML elements to allow.

 

Example

Example 1: Strip tags from a string but also allow the use of DIV elements.

echo mycred_strip_tags( '<div><p>This is a paragraph.</p></div>', '<a><br><em><strong><span><div>' );

 

Return

Returns the given string stripped of tags.

Last edited March 5, 2016