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

razor - Is this a bug in WebMatrix PageData? -

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

c# - Cloning WPF controls and object hierarchies -