Is using a hidden field in a form tag a best practice for passing data in PHP?

Using a hidden field in a form tag is a common practice for passing data in PHP. It allows you to send data from one page to another without displaying it to the user. This can be useful for passing information such as user IDs or form tokens securely.

<form action="process.php" method="post">
  <input type="hidden" name="user_id" value="<?php echo $user_id; ?>">
  <!-- Other form fields here -->
  <button type="submit">Submit</button>
</form>