Help implementation bbcode

Computer builds, hardware and software discussion or troubleshooting, including peripherals. Essentially a general place to talk about desktop computers.
Locked
Anonymous

Help implementation bbcode

Post by Anonymous »

Hi.
It's me again....i know it sounds boring but i'm always trying to improve my CMS.

Code: Select all

function bbcode($string){
	$patterns = array(
  '[size=([1-9]+)](.+?)[/size]is'
	);
	$replaces =  array(
  '<font style="font-size:11pt">2</font>'
	);
	
	$string = preg_replace($patterns, $replaces , $string);

return $string;
}
[code]

this is a portion of the code i use.

I'm using a template system and i would like to add the transformation to a variable....example.

if i use....[color=#006060][b]52[/b][/color]  i would like to save the result in the following.

	$output->size = ???;
	$output->text = ???;

I don't know how to introduce this code inside the function and make it work.

¿Any idea?

Thanks.
Eduardo 

[color=#888888][size=85]Archived topic from Iceteks,  old topic ID:4393, old post ID:35382[/size][/color]
Anonymous

Help implementation bbcode

Post by Anonymous »

Hi....the example was [ font = 5] 52 [ / font ]

Archived topic from Iceteks, old topic ID:4393, old post ID:35392
Locked