| bbcode font-size
|
jman11

msg:4022893 | 4:31 am on Nov 11, 2009 (gmt 0) | how you retrieve the font size from bbcode for example: [size={number}]{text}[/size]
i want to use preg_replace to turn that into <span style="font-size: {number};">{text}</span> this will be with a whole array, where the 'pre-replaced' tag is the key in an array, and the value i want to replace it with is the value like this: $root = array( "/blah/" => "cool" );
thanks :D
|
JohnCanyon

msg:4022935 | 6:22 am on Nov 11, 2009 (gmt 0) | $find = array(key($root), current($root)); $replace = array("{number}","{text}"); $content = "[size={number}]{text}[/size]"; echo str_replace($find, $replace, $content);
|
JohnCanyon

msg:4022936 | 6:24 am on Nov 11, 2009 (gmt 0) | you could also use those values as tokens.. and learn from vincevincevince's one line template engine post. One line template engine [webmasterworld.com] Cheers.
|
jman11

msg:4023233 | 4:48 pm on Nov 11, 2009 (gmt 0) | ok yeh im using that except using the grouped variable thins like "$1" and "$2", is there anyone to do math and divide one by 2? when i try like "content...".$1/2."more content" it like says unexpected number, this is in one of the arrays to do preg_replace by the way.
|
|
|