R3m/framework Function reference string.tag.strip

{string.tag.strip(String $string, String | Array $allowable_tags=null)}

Strip HTML and PHP tags from a string. This function tries to return a string with all NULL bytes, HTML and PHP tags stripped from a given string.

    The input string.   
    You can use the optional second parameter to specify tags which should not be stripped. 
    These are either given as string, or as of PHP 7.4.0, as array. 
    Refer to the example below regarding the format of this parameter. 

// Allow <p> and <a>
{$stripped = string.tag.strip($text, '<p><a>')}

// as of PHP 7.4.0 the line above can be written as:
{$stripped = string.tag.strip($text, ['p','a'])}

Returns the stripped string.

More information:


Last modified: 2021-06-07

© 2021 universeorange.com