BbCode
in package
Table of Contents
Methods
- block() : string
- Convert multi-line text into HTML, with support for bbcode.
- inline() : string
- Convert an inline run of plain text into HTML.
Methods
block()
Convert multi-line text into HTML, with support for bbcode.
public
static block(string $text[, array<string|int, mixed> $tags = null ]) : string
The output will be surrounded by one or more P tags as appropriate
Parameters
- $text : string
-
Plain text to convert
- $tags : array<string|int, mixed> = null
-
Optional array of tags names (e.g. 'b') to process. Provide NULL for defaults (b, i, code, url)
Return values
string —HTML
inline()
Convert an inline run of plain text into HTML.
public
static inline(string $text[, array<string|int, mixed> $tags = null ]) : string
Supports the following bbcode tags: [b] [i] [u] [s] [code] [url=...]
Parameters
- $text : string
-
Plain text to convert
- $tags : array<string|int, mixed> = null
-
Optional array of tags names (e.g. 'b') to process. Provide NULL for defaults (b, i, code, url)
Return values
string —HTML