• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HTML tag to BBcode tag


I am creating a simple blog and i decided to add some BBcode.
I used this helper which worked fine:

But what if i want to edit the topic/message ? Is there any (already written) function i could use to convert the HTML tags into BBcode tags ? BBcode to HTML worked just fine.

Thanks in advance.

LE: i found a solution. I simply convert the BBcode to HTML code only when i echo out (instead of storing the converted version into the database). I should've thought of it earlier. Thanks anyway.

Nice job thinking of that! Yeah, you should definitely store the non-HTML form of the post in the database in case it needs to be updated. You can save the HTML version as well to your database if you'd like - might save your application a bit of headache and speed if you have a lot of traffic.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.