Results 1 to 5 of 5

Thread: Really need your help ** Resolved!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2000
    Posts
    303

    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.

  2. #2
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    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.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2000
    Posts
    303
    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.

  4. #4
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    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.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2000
    Posts
    303
    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
  •  



Click Here to Expand Forum to Full Width