replacing chatacters in a string
Posted: Tue Jul 08, 2003 3:40 am
Hi all,
Got a question, I'm sure the answer is really simple, but I can't seem to be able to do it.
Basically I want to take a string and replace any ' in the string with ` . I looked at the str functions and couldn't seem to find anything that would do it.
I wrote this :
Thank you for any help!
RedRasper
Got a question, I'm sure the answer is really simple, but I can't seem to be able to do it.
Basically I want to take a string and replace any ' in the string with ` . I looked at the str functions and couldn't seem to find anything that would do it.
I wrote this :
Code: Select all
<?php
$test = "i've don't can't `' '` ";
$length = strlen($test);
for($i=0;$i<$length;$i++)
if($test[$i] == "'")
$result[$i] == "`";
?>RedRasper