title: Php write files and save as .java
body: <p>In php I wan to write code into a file and compile it in a server. </p>
  
  <p>But the fopen()  always create a file with .txt, is there a way I can create a file using php and write it into a file and save it with .java extension? </p>