Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: PHP Discussion Boards Two different ways to create BBcode Tutorial

Two different methods for creating bbcode for your scripts

Tutorial Details:

PHP Tutorials

This is a practical guide on creating simple and complex bbcode with php

Part 1: Simple bb code
This techinque for simple bb code can be used to easily replace tags with no attributes like the bold and italic tags.

$string = "I am so [b]cool[/b] "
$bb-replace = array('[b]','[/b]','[i]',[/i]);
$bb-replacements = array ('','','','');
$string = str_replace($bb-replace,$bb-replacements,$string);

Two arrays are defined one for the bb code and another one for the html that will replace the bbcode and then the str_replace function is used to replace the html text for the bbcode in the string.

The same technique may also be used for things such as creating a swear filters, smilies and emoticons etc..



 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
PHP Discussion Boards Two different ways to create BBcode Tutorial

View Tutorial:
PHP Discussion Boards Two different ways to create BBcode Tutorial

Related Tutorials:

Opening up new ports to Java with javax.comm - JavaWorld - September 1998
Opening up new ports to Java with javax.comm - JavaWorld - September 1998
 
Build servlet-based enterprise Web applications - JavaWorld - December 1998
Build servlet-based enterprise Web applications - JavaWorld - December 1998
 
An instrumentation network for weather data on the Web
An instrumentation network for weather data on the Web
 
How to attach a user interface to a Jini service - JavaWorld October 1999
How to attach a user interface to a Jini service - JavaWorld October 1999
 
Java performance programming, Part 3: Managing collections - JavaWorld February 2000
Java performance programming, Part 3: Managing collections - JavaWorld February 2000
 
Script JavaBeans with the Bean Scripting Framework - JavaWorld March 2000
Script JavaBeans with the Bean Scripting Framework - JavaWorld March 2000
 
Programming XML in Java, Part 3 - JavaWorld July 2000
Programming XML in Java, Part 3 - JavaWorld July 2000
 
Brewing entity Enterprise JavaBeans - JavaWorld September 2000
Brewing entity Enterprise JavaBeans - JavaWorld September 2000
 
Sockets programming in Java: A tutorial - JavaWorld December 1996
Sockets programming in Java: A tutorial - JavaWorld December 1996
 
Will Big Blue eclipse the Java tools market?
Will Big Blue eclipse the Java tools market?
 
Integrate Java and C++ with Jace
Integrate Java and C++ with Jace
 
Effort on the edge, Part 1
Effort on the edge, Part 1
 
Chart a new course with JFreeChart
Chart a new course with JFreeChart
 
Fixing the Java Memory Model, Part 1
JSR 133, which has been active for nearly three years, has recently issued its public recommendation on what to do about the Java Memory Model (JMM).
 
Backing Up and Restoring A MySQL Database
Backing Up and Restoring A MySQL Database Backing Up and Restoring A MySQL Database This tutorial explains the how to backup and restore the MySQL Database. Databases are used to store large amount of precious data and it becomes very important to
 
Welcome to the Apache Struts Tutorial
This is the complete Struts Tutorial. Explains ActionForm Action Class Validation Framework.
 
Java RMI Tutorial
This is a brief introduction to Java Remote Method Invocation (RMI). Java RMI is a mechanism that allows one to invoke a method on an object that exists in another address space.The other address space could be on the same machine or a different one. The
 
Beginner to advance guide to the Apache Struts
Beginner to advance guide to the Apache Struts The Complete Apache Struts Tutorial This complete reference of Jakarta Struts shows you how to develop Struts applications using ant and deploy on the JBoss Application Server. Ant script is provided
 
What is WAP? Detailed discussion of WAP API with examples.
What is WAP? Detailed discussion of WAP API with examples. Learn WAP in 60 minutes W ireless Application Protocol or WAP for short, allows the developers to develop next generation web application for cellular devices. Through WAP enabled mobile
 
What is Web Hosting
What is Web Hosting What is Web Hosting? What is Web Hosting? If you have a company and want web presence than you need a website. With the website any one from the world must be able to view your pages, images etc. Website is actually a
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.