Closed jj5 closed 7 years ago
I've used a preg_replace
for now. The above is probably more efficient (would be fun to quantify), and can be revisited later.
One check that could be done above is the string length - just return $string
if its length is less than 2, since the minimum length of a quoted string is 2 - just two quotes.
The check I would do here is to see if the first byte is "
and then if the last byte is a "
. If both are true, then return (something like) substr($string, 1, -1)
.
Got rid of the preg_replace
, which should speed things up a bit.
Hey. Try stripQuotes like this: