Jump to content

Recommended Posts

I not sure if bbcode was the term for this..

how this can be done? for example in this forum, with the open and closing

some code here

or [/img]link of image here[/img] and on the display it is display with a ceratin CSS/format or something..is this can be done through "eregular expression"? and before saving on the dbase [/img] is converted to <img src"" />? am I right? 

 

is there a string function in PHP to make the searching of tags easy?

 

all I need is the concept

 

thanx..

Link to comment
https://forums.phpfreaks.com/topic/46842-solved-how-was-bbcode-done/
Share on other sites

yes bbcode is done by regular expressions (regex for short). When doing BBCode parsing don't parse the BBCodes when it goes into the database. Instead only parse when you go to display the data on the web page.

 

This way it makes editing the content whole lot easier. If you parsed the BBCodes when you inserted it in to the database then when you go to edit it you will have convert the HTML back in to BBCode format in order to edit it.

 

It is always best to put data in to the database in it's rawest format. Also you should only format the data how you want it when you go to display it.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.