EREGI_REPLACE - HELP!
| From: | Chris Murley | Date: | Tue, 01 Aug 2000 18:20:40 +0000 |
| Subject: | EREGI_REPLACE - HELP! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-9508@lists.php.net to get a copy of this message | ||
I have a form, with an HTML <option> tag.
The tag has info like:
<select name=Category>
<option>category1\animals
<option>category2\people
<option>category3\other
</select>
when i submit the form, i should have that choice in the variable
$Category and i do, it works great, i then insert that into a mysql
database, and from another webpage, i select that record and view the
info. the problem is when i view it, it looks like:
Category: category2people
I lost the back slash.
so i thought before i pout it in the database, i should add an extra slash
there... soooo
$Category = eregi_replace("\", "\\", "$Category");
thats what i want to do, but it gives me errors because oif the slashes.
so i try:
$Category = eregi_replace("\\", "\\\\", "$Category");
which gives me:
Warning: REG_EESCAPE
What is going on? Can anyone help? Is there a better way to do this?
Thanks
Chris