How to embed PHP code in a File?


To embed PHP code inside a file, it has to be inside a special set of opening and closing tags.
PHP supports the following tags sets:
1. Opening (< ?php) and closing (? >)
2. Opening (< ?) and closing (? >)
3. Opening (< %) and closing (% >)
4. Opening (< script language=”php” >) and closing (< /script >)

Example:

< html >
…..< head >
……….< title >Sample document< /title >
…..< /head >
…..< body >
……….< ?php
……………echo “Sample text”;
……….? >
…..< /body >
< /html >

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Leave a Reply