PHP-Fusion Development

parse_textarea()

Parse BBCodes, smileys and any special characters to HTML string.

Versions: 9

parse_textarea( string $value [, bool $parse_smileys, bool $parse_bbcode, bool $decode, string $default_image_folder, bool $add_line_breaks, bool $descript ] ) : string

Parameters

$value (string) (Required) String with unparsed text.

$parse_smileys (bool) (Optional) Smiley parsing. Default value: true

$parse_bbcode (bool) (Optional) BBCode parsing. Default value: true

$decode (bool) (Optional) Decode HTML entities. Default value: true

$default_image_folder (string) (Optional) Image folder for parse_imageDir(). Default value: IMAGES

$add_line_breaks (bool) (Optional) Allows nl2br(). Default value: false

$descript (bool) (Optional) Sanitize text. Default value: true

Return Values

(string) Parsed string.

Examples

$value = 'Text :D [url]http://example.com/[/url]';
echo parse_textarea($value, TRUE, TRUE, FALSE);
// Text <img src='http://example.com/images/smiley/grin.svg' alt='Grin'> <a href='http://example.com/'>http://example.com/</a>