In PHP, the ______ function is used to replace some characters in a string with some other characters.
- str_replace()
- replace()
- substr_replace()
- swap()
The str_replace() function in PHP is used to replace some characters in a string with some other characters. It performs a search and replace operation on a given string. It replaces all occurrences of the specified search string with the replacement string. Learn more: https://www.php.net/manual/en/function.str-replace.php
Loading...
Related Quiz
- PHP constants are case-_________.
- You need to execute a block of code in your PHP script for each key-value pair in an associative array. How would you do this using a foreach loop?
- An object in PHP is created using the new keyword followed by the class name.
- The $_SERVER superglobal in PHP is often used to get the URL of the current page.
- You are writing a PHP script and you want to execute a block of code a fixed number of times. How would you do this using a for loop?