PHP ReGex Case Insensitive

PHP RegEx: Case Insensitive

Submitted by ronard on
In previous tutorial we match at the beggining of the string given. But that is a case sensitive. If your condition like this: if(preg_match("/^ABC/", $string)) then the value of your string "abc". The script will returned with this message: No match found This is because of case sensitive. But in this script we will make the condition insensitive using regex "i" for insensitive. Shown below: Even