How would I remove all spaces between single quotes skipping escaped quotes in PHP

mr.metro

New Member
Exactly as the title asks:How would I remove all unnecessary spaces between single quotes skipping escaped quotes in PHP?I am looking for a fast implementation to pre-prep for parsing. I would prefer not to use regex if it would be slower than using a simple loop.(The double quotes below are for display purposes only)examples would be:input: \[code\]" testing ' this is a \'test\' ' zzz "\[/code\]output:\[code\]"testing ' this is a \'test\' ' zzz"\[/code\]
 
Back
Top