27 Feb 2013

SYNTAX -- php tags

Where to place PHP code ?
First open notepad and Copy below images code in notepad or whatever your PHP-editor and save as abc.php (You can change file name but not extension) in your newproject folder (You can change the path but it should be in htdocs folder).
eg. c:\xampp\htdocs\newproject\abc.php

When PHP parses a file, it looks for opening and closing tags, which tell PHP to start and stop interpreting the code between them.

1.1st type is like this in below image.


2.Alternately you can choose to have many PHP blocks exactly located in the HTML Head or Body section of the document where that certain data would display. which is wrote in below image.


3. You can also write like below code.