The following snippet converts firstName into first Name
When exporting data to CSV line breaks can cause problems getting the data into the correct columns, removing them is the best course of action. This array will remove n and r and commas.
Using preg_split to separate words where a capital letter is found.
This will remove all non-integer characters, including commas and currency symbols. The output is a float.