You could do multiple search and replaces that search for ^ *(\w+)(.*)\r\n *(\w+) and replace with !\1=\3\r\n\2\r\n, assuming Windows style line endings. Then run another simple edit to remove the leading ! characters. Using the example from the question
field1 field2 field3 field4 ...
value1 value2 value3 value4 ...
The first replacement yields:
!field1=value1
field2 field3 field4 ...
value2 value3 value4 ...
The next replacement yields:
!field1=value1
!field2=value2
field3 field4 ...
value3 value4 ...
After two more replacements it completes leaving:
!field1=value1
!field2=value2
!field3=value3
!field4=value4
...
...
The remaining edits would need to tidy up ! and the . characters.
The search string allows optional spaces at the beginning of the line the ^ *.
It then looks for a field-name (\w+) and the rest of that line (.*) and a line separator \r\n.
Next it looks for optional spaces then a field-value with *(\w+).
The replacement just reorders the found fields and adds a leading ! so that a subsequent replace-all operation will not find thefields already matched.
Not exactly sure how to map this on to PHP, but it works fine in Notepad++ version 6.5.5.