replace small tag with pixel size

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dustyyy
Forum Newbie
Posts: 2
Joined: Mon Aug 04, 2008 5:32 pm
Contact:

replace small tag with pixel size

Post by dustyyy »

can someone help me replace the <small> tag with a pixel size using an array?

Code: Select all

array("1"=>"10px","2"=>"8px");  
the key being the amount of consecutive <small> tags and value their pixel equivalent. the array is optional if there is another way to hold the conversion information.

for example:

Code: Select all

<small>hello world</small> would print at 10px
<small><small>hello world</small></small> would print at 8px
thanks for any help you can provide!
Last edited by dustyyy on Mon Aug 04, 2008 6:01 pm, edited 1 time in total.
manixrock
Forum Commoner
Posts: 45
Joined: Sun Jul 20, 2008 6:38 pm

Re: replace small tag with pixel size

Post by manixrock »

The <SMALL> tag is shorthand for <FONT SIZE="-1">. The sizes vary a lot accross browsers and OS's. A table sowing them can be found here: http://www.netmechanic.com/news/vol3/design_no8.htm.
dustyyy
Forum Newbie
Posts: 2
Joined: Mon Aug 04, 2008 5:32 pm
Contact:

Re: replace small tag with pixel size

Post by dustyyy »

thanks but i'm actually looking for a php function to replace the small tag using the specified array. where 1 small tag would equal 10px and 2 small tags would equal 8px.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: replace small tag with pixel size

Post by RobertGonzalez »

That makes no sense. 10px worth of what? How would PHP do that for you?

If you have <small> set a css rule that it has to be certain dimensions. If you have a <small> with a descendant <small> have a CSS rule for that too. There is nothing in PHP that you would need to do this with.
Post Reply