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 245 views
1 answer 143 views
143 views asked Oct 15, 2019 by avibootz
2 answers 193 views
1 answer 207 views
1 answer 149 views
1 answer 155 views
...