- implode: documentation ( source)
- htmlspecialchars: documentation ( source)
- sprintf: documentation ( source)
<?php
$allowed = array('<p>', '<b>', '<i>', '<u>');
echo (implode(', ', $allowed));
echo (sprintf('Allowed HTML tags: %', htmlspecialchars(implode(', ', $allowed))));