In PHP, what are the best practices for creating buttons that act as links to external pages?

When creating buttons that act as links to external pages in PHP, it is best practice to use HTML anchor tags within a form element to ensure accessibility and proper functionality. This allows users to navigate to the external page when the button is clicked. Additionally, it is important to use the "target" attribute to specify that the link should open in a new tab or window, rather than navigating away from the current page.

<form action="external_page.php" method="get">
  <button type="submit">
    <a href="https://www.externalpage.com" target="_blank">Go to External Page</a>
  </button>
</form>