Replace whitespaces using PHP preg_replace function ignoring quoted strings
- by Saiful
Look at the following string:
SELECT
column1 ,
column2, column3
FROM
table1
WHERE
column1 = 'text, "FROM" \'from\\\' x' AND
column2 = "sample text 'where' \"where\\\" " AND
( column3 = 5 )
I need to escape unnecessary white space characters from the string like:
removing white space from beginning and ending position of…