Reputation: 38
I am a PHP beginner.
When going through a PHP script I found:
if(preg_match('/(?i)ID=(\d+)/',$input)) { // id found }
I want to know what does (?i)
mean ?
Upvotes: 1
Views: 68
Reputation: 2308
The below line is finding matching pattern in $input string like ID=any number.
preg_match('/ID=(\d+)/i',$input)
Example matching patterns are ID=2 id=34 Id=23
Upvotes: 1
Reputation: 455440
(?i)
is a in line modifier which makes the match case insensitive.
It is equivalent to adding a i
after the closing delimiter:
if(preg_match('/ID=(\d+)/i',$input))
^
Upvotes: 2