I made little javascript bbcode editor on my website. How to display that code from mysql? Or how to save in mysql as html that code?
web3
0
Junior Poster in Training
Recommended Answers
Jump to Post<?php function parseBBCode($text) { $ALLOWABLE_TAGS = array("b", "i", "u"); //Add tags here static $PATTERNS = array(); static $REPLACEMENTS = array(); if (count($PATTERNS) == 0) { foreach ($ALLOWABLE_TAGS as $tag) { $PATTERNS[] = "/[$tag]/i"; $PATTERNS[] = "/[\/$tag]/i"; $REPLACEMENTS[] = "<$tag>"; $REPLACEMENTS[] = "</$tag>"; } } $result = str_replace(array(">", …
Jump to PostLooks good. How about having allowable bbcode tags set to different html tags? b -> strong, i -> em. That should make it more xhtml-compliant.
All 6 Replies
php?
0
Newbie Poster
diafol
web3
0
Junior Poster in Training
diafol
web3
0
Junior Poster in Training
diafol
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.