preg_split by space and tab outside quotes
问题 I am trying to get preg_split() to split the following 2 strings, by space/tab (needs to work on both). autodiscover.microsoft.com. 3600 IN A 131.107.125.5 and microsoft.com. 3600 IN TXT "v=spf1 include:_spf-a.microsoft.com include:_spf-b.microsoft.com include:_spf-c.microsoft.com -all" The trick is that in the second instance the last part with quotes, should not be split. From looking on the StackOverflow, I have found that I probably need to use this. $results = preg_split("/'[^']*'(*SKIP)