Display strings with single quotes
| From: | Rea_David at emc dot com | Date: | Thu, 20 Feb 2003 11:34:03 +0000 |
| Subject: | Display strings with single quotes | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-136338@lists.php.net to get a copy of this message | ||
Hi all,
Have simple but annoying issue, I want to display a string within an
input field. This string contains ' & so when it's being display the,
anything after the ' is being left out. Here is the code I'm using:
$string = str_replace("'", "''", $string);
$string = stripslashes($string);
echo "<input type=text name='value' size=20 value =
'$string'>";
Thanks
Dave