how to convert to small caps
Moderator: General Moderators
-
mramardeeepsingh
- Forum Newbie
- Posts: 5
- Joined: Wed Dec 13, 2006 2:05 pm
how to convert to small caps
hi friends
i want to know that how can i replace the entire content in <..............> tags.
for example
i have a code
<STRONG><I><B><FONT COLOR="red">Example Text</FONT></B></I></STRONG>
and i want to convert the html tags to small caps without converting the text i.e Example Text.
<STRONG> should be <strong>
<I> should be
<FONT COLOR="red"> should be <font color="red">
but keeping the text i.e Example Text intact.
due to which i can't use strtolower.
please tell me how to convert the html tags into smallcaps.
what regular expression to use so that i get
<strong><font color="red"><b>Example Text</b></font></strong>
in simple words i want html tags to be converted to small caps, remaining the text intact.
please help
i want to know that how can i replace the entire content in <..............> tags.
for example
i have a code
<STRONG><I><B><FONT COLOR="red">Example Text</FONT></B></I></STRONG>
and i want to convert the html tags to small caps without converting the text i.e Example Text.
<STRONG> should be <strong>
<I> should be
<FONT COLOR="red"> should be <font color="red">
but keeping the text i.e Example Text intact.
due to which i can't use strtolower.
please tell me how to convert the html tags into smallcaps.
what regular expression to use so that i get
<strong><font color="red"><b>Example Text</b></font></strong>
in simple words i want html tags to be converted to small caps, remaining the text intact.
please help
You'll want to use preg_replace.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
I'd recommend preg_replace_callback() over preg_replace(). Security concern..
-
mramardeeepsingh
- Forum Newbie
- Posts: 5
- Joined: Wed Dec 13, 2006 2:05 pm
can u provide me the code
can you provide me the code for the same.
-
mramardeeepsingh
- Forum Newbie
- Posts: 5
- Joined: Wed Dec 13, 2006 2:05 pm
-
mramardeeepsingh
- Forum Newbie
- Posts: 5
- Joined: Wed Dec 13, 2006 2:05 pm
If you want to learn about regular expressions start with http://www.regular-expressions.info/tutorial.html
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Or you could read the manual for preg_replace_callback() and preg_replace(). Seriously though, very few people here are going to write your code for you. At the very least, give it a shot. If what you try fails, post your code so we can see what you are doing and help walk you through it. A lot of us here are more than happy to help you figure your problems out. But, like I said, few of us will actually solve your problems for you.
-
mramardeeepsingh
- Forum Newbie
- Posts: 5
- Joined: Wed Dec 13, 2006 2:05 pm