Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<html>
<head>
<title>BBCode пример с array и str_replace</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1251">
<style type="text/css">
body { font-family: verdana; font-size: 11px; color: #333333; }
div.code { width: 450px; margin: 15px; padding: 3px; border: 1px solid #A80000; color: #F00000; font-family: fixedsys; }
</style>
</head>
<body>
<?php
$prom = "[b]удебелен[/b] [u]подчертан[/u] [i]наклонен[/i] [s]задраскан[/s] [code]а това тук е някакъв код ;)[/code]";
$bbc1 = array("\n", "[b]", "[/b]", "[i]", "[/i]", "[u]", "[/u]", "[s]", "[/s]", "[code]", "[/code]");
$bbc2 = array("<br>", "<b>", "</b>", "<i>", "</i>", "<u>", "</u>", "<s>", "</s>", "<div class='code'>", "</div>");
echo str_replace($bbc1,$bbc2,$prom);
?>
</body>
</html>