|
-
Jul 7th, 2004, 12:36 PM
#1
Thread Starter
Hyperactive Member
Really need your help ** Resolved!
Hi all,
I would like to be able to use a php script/function that will
change the color of any text after the colon. For example,
There are many languages: English, French, etc... And
even more computer languages: C, VB, Php etc...
So what I would like to have the function do is:
There are many languages: <font color="blue">Englis, French, etc... <font>And
even more computer languages: <font color="blue">C, VB, Php etc...</font>
Any idea or help is appreciated!
Last edited by jxiong; Jul 7th, 2004 at 01:26 PM.
-
Jul 7th, 2004, 12:45 PM
#2
Frenzied Member
use str_replace() to find all colon's and replace then with <font...>:
then same thing for etc... >> etc..</font ..>
Have I helped you? Please Rate my posts. 
-
Jul 7th, 2004, 12:52 PM
#3
Thread Starter
Hyperactive Member
Thanks for your reply. I thought about that already but my
problem is there could be text (regulary sentences)
between each colon. Here is an example of what I meant:
This is a test: ABC. Now comes a normal line. Five: Is 5.
I could get it work on just one simple colon.
Last edited by jxiong; Jul 7th, 2004 at 01:05 PM.
-
Jul 7th, 2004, 01:15 PM
#4
Frenzied Member
well. you have to have some way of PHP to know when it shoudl replace it and when it shouldn't. You could give a <span> tag a special id attribute. then make the PHP only look in there. This would be a bit tricky to code, but not too hard.
Have I helped you? Please Rate my posts. 
-
Jul 7th, 2004, 01:19 PM
#5
Thread Starter
Hyperactive Member
Thanks for your help. I think I got it now.
Last edited by jxiong; Jul 7th, 2004 at 01:27 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|