I need help plz

Started on the old forum in August 2011 · view the original in the archive · old links redirect here

5 replies · 604 views · started 15 years ago · 1 min read

2 participants
carebear Developer · 68 posts #1
$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 🙂

arnage Lead · 811 posts #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.

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
carebear Developer · 68 posts #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...

carebear Developer · 68 posts #5

thanks will that work on WapDesire V2

arnage Lead · 811 posts #6

No reason not to.

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close