0

I just use fputcsv, but output is "csv UTF8-without BOM". I want normal UTF8 with BOM, how to do that?

1 Answer 1

2

Use the code below

header('Content-Encoding: UTF-8');
header('Content-type: text/csv; charset=UTF-8');
header('Content-Disposition: attachment; filename=test.csv');
echo "\xEF\xBB\xBF"; // UTF-8 BOM

Hope this helps you

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.