if you have a hand coded site to help with your SEO you need a canonical link.
Below is a PHP script that creates a canonical url link on page load.
So this should answer your question of how to add canonical tag in PHP
This is a self-referencing canonical link
';
?>











