A php function for removing "\" from a sentence ??
Posted: Thu Jul 23, 2009 4:55 am
Hi,
I hope someones come across this problem. The problem is everytime php see's a apostophe (their's) it automatically adds a backslash to it. I was hoping if anyone had a function to remove all the backslashes from a given sentance.
I have written a little snippet of code and was hoping if someone could have a look and see where i'm going wrong.
THANKS.
<ALL HELP APPRECIATED>
Here's my code below:
<?php
//Remove all backslash
$address="hello worl'd";
$n = strlen($address);
for($i=0; $i<$n; $i++)
If substr("$address","$i","$i", <> "\") //then
{
substr($address);
}
?>
I hope someones come across this problem. The problem is everytime php see's a apostophe (their's) it automatically adds a backslash to it. I was hoping if anyone had a function to remove all the backslashes from a given sentance.
I have written a little snippet of code and was hoping if someone could have a look and see where i'm going wrong.
THANKS.
<ALL HELP APPRECIATED>
Here's my code below:
<?php
//Remove all backslash
$address="hello worl'd";
$n = strlen($address);
for($i=0; $i<$n; $i++)
If substr("$address","$i","$i", <> "\") //then
{
substr($address);
}
?>