php - preg_match check if string is surrounded in double or single quotes -
can tell me regex see if surrounded in double or single quotes.
"this string" i want return false if quotes not present @ or not present @ start , end.
preg_match('/^(["\']).*\1$/m', $string);
will return 1 if string surrounded double quotes , 0 if not.
Comments
Post a Comment