Jump to content

Quick Method in adding $html and "\n" to HTML


kiwigirl

Recommended Posts

I'm confused as to what exactly this does. So this opens up a .HTML file, adds the .php extension, <?php and ?> at the beginning and end of the file, and then echos out the entire contents of the original file?

 

...How is that useful? (I suppose it could be useful as a exercise in learning about opening and saving files, but I don't see the final .php file that the script creates all that useful?). You'd be better off simply renaming the .html file to use a .php extension, keeping the HTML as is, and only adding your PHP code wherever it is necessary. There's absolutely no reason to echo out the entire contents of the HTML file if you can use standard HTML instead and avoid the use of PHP all together.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...