Jump to content


Photo

String replace help


  • Please log in to reply
1 reply to this topic

#1 Patrick3002

Patrick3002
  • Members
  • PipPipPip
  • Advanced Member
  • 89 posts
  • LocationMy Computer

Posted 20 October 2006 - 04:19 AM

Hi, i was wondering if anyone could help me with this code:

<form name="strreplace" action="strreplace.php" method="post">
<textarea name="main" cols="50" rows="40" wrap="VIRTUAL" id="main"></textarea>
<input type="submit" value="Submit">
</form>

<?

$main=$_POST['main'];
$main = str_replace("c:","<br>f:","$main");

echo nl2br(stripslashes($main));

?>

Now i was wondering instead of replacing "c:" with "f:" is it possible to replace a " with \"
If my computer dies, it doesn't die alone.
.....I die with it.

#2 Patrick3002

Patrick3002
  • Members
  • PipPipPip
  • Advanced Member
  • 89 posts
  • LocationMy Computer

Posted 20 October 2006 - 04:28 AM

I've figured it out, thanks anyways.
If my computer dies, it doesn't die alone.
.....I die with it.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users