How to insert PHP code into HTML?

To be able to use php code on a page with an extension other than .php, you need a server which supports .htaccess files. To add an extension to be parsed for php, create or edit a file called .htaccess (with the dot first) containing the following line:

fwrite() example

Description int fwrite ( resource $handle , string $string [, int $length ] ) fwrite() writes the contents of string to the file stream pointed to by handle .