Can someone tell me the regex to see if something is surrounded in double or single quotes.
"this is the string"
i want it to return false if it quotes are not present at all or not present at the start and the end.
preg_match('/^(["\']).*\1$/m', $string);
will return 1 if the string is surrounded by double quotes and 0 if it is not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With