The Daily Click ::. Forums ::. Non-Klik Coding Help ::. PHP - custom markup
 

Post Reply  Post Oekaki 
 

Posted By Message

Zane



Registered
  09/09/2003
Points
  1183
27th January, 2005 at 14:25:30 -

In php, what is the best way to create custom forum markup.
The only may I currently know haow to do it is a simple string replace.
eg:
[b] is replaced by

Thats okay for smple tags like the bold tage, but its not very good for the more complex ones like image tages or link tags. And its not very flexible.

So yes, is there a better way to do it?

 
www.klikforever.co.uk
GO THERE!!!

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
27th January, 2005 at 14:47:43 -

try using preg_replace();
check http://uk.php.net/manual/en/function.preg-replace.php for some explanations and examples of the function.

Image Edited by the Author.

 
My signature is never too big!!!

Zane



Registered
  09/09/2003
Points
  1183
28th January, 2005 at 07:16:06 -


sorted

 
www.klikforever.co.uk
GO THERE!!!

Galaxy613



Registered
  29/01/2003
Points
  1765
21st February, 2005 at 10:37:37 -

Couldn't you just use Str_Replace()?

<?
$string="[url='http://creategame.com']Is a place![/url]";
$string=Str_Replace("[url='","<a href=\"",$string);
$string=Str_Replace("']","\">",$string);
$string=Str_Replace("[/url]","</a>",$string);
Echo $string;
?>

|Edit| I mean Str_Replace

Image Edited by the Author.

 
Image
My forum: http://subsoap.com/ck/forums/index.php

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
21st February, 2005 at 12:26:18 -

read the post:
"Thats okay for smple tags like the bold tage, but its not very good for the more complex ones like image tages or link tags. And its not very flexible."

 
n/a
   

Post Reply



 



Advertisement

Worth A Click