What are the best practices for writing meta descriptions in PHP to improve search engine optimization?

Best practices for writing meta descriptions in PHP to improve search engine optimization include keeping them between 50-160 characters, including relevant keywords, and making them unique for each page.

<?php
$meta_description = "Your meta description goes here";
echo '<meta name="description" content="' . $meta_description . '">';
?>