I need to ensure punctuation marks are converted to HTML characters so I can run a one off script (an importer) using data in a spreadsheet.
The code is below. I want all $data variables punctuation to be converted to html codes so that punctuation marks don't cause errors in my script and so they display correctly on my website when called from the database.
I have used this in the past: htmlspecialchars($data)
but I don't know the syntax for this particular format of code.
$import="INSERT into venue(name,address1,address2,telephone,email,website) values('$data','$data','$data','$data','$data','$data')