PHP code example of igorakaamigo / php5-tiny-bbcode
1. Go to this page and download the library: Download igorakaamigo/php5-tiny-bbcode library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
igorakaamigo / php5-tiny-bbcode example snippets
use \Igorakaamigo\Utils\BBCode;
echo BBCode::convert('[b]A bold string[/b]');
// Outputs: <strong>A bold string</strong>
echo BBCode::convert('<span>A text</span>');
// Outputs: <span>A text</span>
echo BBCode::convert('[i]Hi there![/i]');
// Outputs: <em>Hi&nbsp;there!</em>
echo BBCode::convert('[i]Hi there<br>!!![/i]', [' ', '<br>']);
// Outputs: <em>Hi there<br>!!!</em>
echo BBCode::convert('Magic links: email me at [email protected]');
// Outputs: Magic links: email me at <a href="mailto:[email protected]">[email protected]</a>
echo BBCode::convert('Magic links: http://www.domain.tld/path/to/resource');
// Outputs: Magic links: <a href="http://www.domain.tld/path/to/resource">http://www.domain.tld/path/to/resource</a>
sh
php composer.phar