How to replace string with another in PHP

1 Answer

0 votes
$search = 'C#';
$replace = 'C++';
  
$s = 'PHP Java Python C#';
  
$s = str_ireplace($search, $replace, $s);
  
echo $s;

   
       
/*
run:
            
PHP Java Python C++
     
*/

 



answered Oct 15, 2019 by avibootz
...