|
Posted by Rik on 06/26/06 14:42
monomaniac21 wrote:
> Hi all ive added a form to a script using php and the form is to hold
> sizes of a product which means the client needs to be able to use " to
> denote inches. However when this is entered and the form submitted it
> makes it into the table and then displays as text on the page but not
> inside the form as its value. Is there a way around this?
htmlspecialchars($string);
Among others, it will replace '"' with '"'
> Ive tried replacing " with ' and a ' together but can't get this to
> work in the str_replace funtion example: str_replace('"', '''',
> $string); and help would be greatly appeciated!
Ugly solution, but here;s how it would work:
str_replace('"', '\'\'',$string);
or
str_replace('"', "''",$string);
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|