ThomasJSmart
Programmer
- Sep 16, 2002
- 634
bit of a problem here.
im getting text from a database, this text is html formatted and the problem is the text is given to me (posted) in this format:
<font face=verdana color=#FFFFFF> bla </font>
as you can see the "'s are missing,
now for html use this doesnt realy matter, problem is i need the text for flash
and flash needs the quotes which is needlesly to say quite anoying.
now iv been doing ok in php up to now with this trick:
$string = str_replace("face=verdana","face=\"verdana\"",$string);
the problem arises with the color tag....
get my drift?
to many options,
color=# is easy, i can str_replace this no problem but the end is causing a difficulty
str_replace ("f","f\""
isnt realy gonna work cus then it will turn freak into f"reak in my regular text.
str_replace ("color=#ffffff","color=\"#ffffff\""
isnt going to work because there are.... how many colors? lots
and now im kinda at a loss ....
any help apreciated, im open to any ideas be they php, flash or javascript based.
i can change the text befor it goes into the database after its been posted and when i get it out of the database, i just cant change the fact that the form is posted without the "'s
thanks,
Thomas
I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
im getting text from a database, this text is html formatted and the problem is the text is given to me (posted) in this format:
<font face=verdana color=#FFFFFF> bla </font>
as you can see the "'s are missing,
now for html use this doesnt realy matter, problem is i need the text for flash

now iv been doing ok in php up to now with this trick:
$string = str_replace("face=verdana","face=\"verdana\"",$string);
the problem arises with the color tag....
get my drift?
to many options,
color=# is easy, i can str_replace this no problem but the end is causing a difficulty
str_replace ("f","f\""

str_replace ("color=#ffffff","color=\"#ffffff\""

and now im kinda at a loss ....
any help apreciated, im open to any ideas be they php, flash or javascript based.
i can change the text befor it goes into the database after its been posted and when i get it out of the database, i just cant change the fact that the form is posted without the "'s
thanks,
Thomas
I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!