...

View Full Version : cant figure out how to delete "\." from a string.



V@no.
03-17-2003, 08:34 PM
Hi!
after using
quotemeta("[user@domain.com]");I get
\[user@domain\.com\]
and now I can not figure out how to rid off \. from that string....
here is what I was trying to use:

preg_replace("/\\\./", ".", "\[user@domain\.com\]");
I tryed all kind of combinations with no result.

Can someone help me with that?
thanks!

Íkii
03-17-2003, 09:19 PM
tried stripslashes($string); ?

V@no.
03-17-2003, 11:42 PM
Originally posted by Íkii
tried stripslashes($string); ?
stripslashes will remove ALL slashes, but I need them all, exept the one before " . "

firepages
03-18-2003, 02:46 AM
<?
$str=str_replace('\.','',$string);
?>

V@no.
03-18-2003, 03:33 AM
Originally posted by firepages


<?
$str=str_replace('\.','',$string);
?>

thank you!
with little modification it worked as I wanted!
P.S. what's wrong with PHP CODE on this forum? it strips slashes...
it's nice see in color the code, but when it doesnt show everything, I'd prefere use [ code ]....[ /code ] instead...

Thanks again!

firepages
03-18-2003, 03:52 AM
lol - sorry I did not check my post , the forum did indeed remove the all-important slash

str_replace('\.','',$string);

that or its Spookster who has a habit of editing my posts :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum