This function takes a string, and checks to see if it needs to be wrapped in double quotes. This is important for CSV files.
Each field is seperated by a comma, but if the data in that field contains a comma, it needs to be quoted. Also, because of those quotes, if the field data contains a quote it needs to be escaped (by adding another quote directly after it).
You would perform this function for every field in the row, not once for the entire row.
Added by JC on 13th January, 2008
There are no comments about this snippet.
You must be registered and logged in to post a comment.
Login here to post a comment