PHP blocks(tags) can go anywhere you like in a .php web page document. Anywhere. Many PHP developers choose to make one large PHP block above their <!DOCTYPE> and <html> tags. In this block they would handle all of the information gathering, parsing, or whatever needs to be scripted. They then make variables out of information to echo or print the values out to the browser.
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.
Both of these scripts below are the same in functionality, and will render the exact same output.