|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
one preg_replace
I need one preg_replace function to replace "rn" with "<br>" except "rn" that beetween [textarea] and [/textarea]
|
|
#2
|
|||
|
|||
|
RE: one preg_replace
you have looked at the nl2br() function? |
|
#3
|
|||||
|
|||||
|
RE: one preg_replace
Hmm.. I'm not that great with regular expressions, but I've come up with this:
php Code:
My problem is, that if rn appears more than once in <textarea></textarea> it is turned into <br>. I can’t seem to find the solution to this. Anyone? |
|
#4
|
|||
|
|||
|
RE: one preg_replace
Is ereryone just as bad as I am at this
|
|
#5
|
|||
|
|||
|
RE: one preg_replace
woooo this was fun.. i think i acheived what you want using a whole bunch of str_replace functions lol. i didn't test it though, i'm sure you'll come up with a more better way anyhow
|
|
#6
|
|||
|
|||
|
RE: one preg_replace
Hehe... Nice job... Only problem is if he meant <textarea> instead of [textarea]. Then you have to take something like <textarea cols="9"...> in consideration...
|
|
#7
|
|||
|
|||
|
RE: one preg_replace
yah plus MULTIPLE textarea's within one string..
|
|
#8
|
|||
|
|||
|
RE: one preg_replace
yep... Would still like to see it in a regular expression. Maybe I could learn somthing :-)
|
|
#9
|
|||
|
|||
|
RE: one preg_replace
|
|
#10
|
|||
|
|||
|
RE: one preg_replace
Yep... Almost the same as mine in post 3... Still need a regular expresion that replaces rn with <br> outside textarea...
|
|
#11
|
|||
|
|||
|
RE: one preg_replace
Yep... Almost the same as mine in post 3... Still need a regular expresion that replaces rn with <br> outside textarea...
|
|
#12
|
|||
|
|||
|
RE: one preg_replace
Hmm.. Strange
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > one preg_replace |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|