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

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -