I have a string like
$str = '11,22,33';
$str = '22,44,55;
$str = '66,22;
how can i use preg match so that by matching 22 in any of string will yield output as 1
i.e (for case 1 it should match “,22,” for case 2 is shd match “22,” , for case3 it should match “,22”)
1 Answer