Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Replace String in PHP

phpCopy<?php
$mystring = "This is my string.";
echo("This is the string before replacement: ");
echo($mystring);
echo("
");
$mynewstring = str_replace(" my ", " ", $mystring);
echo("Now, this is the string after replacement: ");
echo($mynewstring);
?>
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #Replace #String #PHP
ADD COMMENT
Topic
Name
5+8 =