Form input to docx output

I want to generate a .docx file obtaining inputs from a form using JavaScript and PHP. Help please.