I need help plz

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    I need help plz

    Code:
    $text=preg_replace("/\[rainbow\](.*?)\[\/rainbow\]/i","<font color='#5EFF00'>\\1</font><font color='#93FF00'>\\1</font><font color='#C8FF00'>\\1</font><font color='#FFFA00'>\\1</font><font color='#FFC300'>\\1</font><font color='#FE9400'>\\1</font><font color='#FF6700'>\\1</font><font color='#FF3800'>\\1</font><font color='#FF0000'>\\1</font><font color='#FF0039'>\\1</font><font color='#FE006E'>\\1</font><font color='#FF00A4'>\\1</font><font color='#FF00DF'>\\1</font><font color='#D900FF'>\\1</font><font color='#9E00FF'>\\1</font><font color='#6900FF'>\\1</font><font color='#3400FF'>\\1</font><font color='#0006FE'>\\1</font><font color='#003DFF'>\\1</font><font color='#006CFE'>\\1</font><font color='#0099FF'>\\1</font><font color='#00C8FF'>\\1</font><font color='#00FFFD'>\\1</font><font color='#00FFC3'>\\1</font><font color='#00FF8E'>\\1</font>", $text);
    This works but when u write something it comes up more them once eg: if u write just text it comes up just (texttexttext) but i would like it where there colors r running it to new words so if anyone can help that b gr8 cheers

    #2
    Yes it does because where is \\1 in expression it copy content from (.*?).
    U need to create array with explode() to ' ' than loop the loop and than preg_replace.
    Last edited by arnage; 12.08.11, 16:46.
    <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

    Comment


      #3
      Sorry Arnage what do u main as im not with it as im sick with tonsilitis. plus i dont aske for help its only when i really need i try n work it out myself.. so if u just give me a start with it n once i know wht iam doing i b right thanks...

      Comment


        #4
        Ok, check this link.

        www.printedexistence.com/designhelp/phpandmysql/tutorials/rainbowtextgenerator.php
        <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

        Comment


          #5
          thanks will that work on WapDesire V2

          Comment


            #6
            No reason not to.
            <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

            Comment

            Working...
            X