How to String Replace Case Insensitive in PHP?
Hi Dev,
Today, I will let you know example of how to string replace case insensitive in php?. you will learn case-insensitive str_ireplace in php. it's simple example of how can replace string in php?. step by step explain php string replace by using str_ireplace case sensitive function. Here, Creating a basic example of how to replace a word inside a string in php?.
There are example to check if string replace case insensitive in php. in this example, we will use to and str_ireplace() function to check if string replace case insensitive. so let's the following example with output.
Example 1:
index.php
<?php
// Input string
$subjectVal="how are you";
// using str_ireplace() function
$res = str_ireplace("are", "is", $subjectVal);
echo $res;
?>
Output:
how is you
I hope it could help you...
- How To Use Php Conditional Statement Example
- How to Check if String Contains Regex in PHP?
- PHP Array_column() Function Example
- PHP Generate List of Random Numbers Between 0 and 100 Example
- How to User Login with Facebook in PHP?
- How to Explode Every Character into Array Using PHP Example?
- PHP Form Validation Tutorial
- PHP Convert XML to JSON Example