Back to Blog
Php string replace5/31/2023 ![]() Here, we have replaced only one item of the array that is why the count will be 1. Print_r(str_replace("pgsql", "mssql", $data, $i)) $data = array("mysql","pgsql","mongodb","oracle") The count parameter is optional, and it is the variable that counts the number of replacements. The string parameter is required, and it specifies the string to be searched. The replace parameter is required, and it specifies the value to replace the value in finding. Use the str_ireplace() function to perform a case-insensitive search. The str_replace() function is case-sensitive. If the finding value is an array, and replacement is the string, the replacement string will be used for every find value. ![]() If both find and replace are arrays, and replace has fewer elements than found, the empty string will be used as a replacement.If a string to be searched in the array, find and replace is performed with every array element. ![]()
0 Comments
Read More
Leave a Reply. |