How to replace the part of a string with another string in PHP

1 Answer

0 votes
$str = "php c c++ c# java";
 
$str = str_replace("c++ c#", "python", $str);

echo $str;




/*
run:

php c python java

*/

 



answered Jun 18, 2022 by avibootz

Related questions

2 answers 356 views
1 answer 220 views
220 views asked Oct 15, 2019 by avibootz
2 answers 316 views
1 answer 296 views
1 answer 347 views
...