How can PHP be used to assign values to input fields in a web form?

To assign values to input fields in a web form using PHP, you can use the `value` attribute in the HTML input tags and echo the desired values from PHP variables. This allows you to pre-fill the form fields with specific values when the page is loaded.

<form action="process_form.php" method="post">
  <input type="text" name="username" value="<?php echo isset($_POST['username']) ? $_POST['username'] : ''; ?>" placeholder="Enter your username">
  <input type="email" name="email" value="<?php echo isset($_POST['email']) ? $_POST['email'] : ''; ?>" placeholder="Enter your email">
  <textarea name="message" placeholder="Enter your message"><?php echo isset($_POST['message']) ? $_POST['message'] : ''; ?></textarea>
  <input type="submit" value="Submit">
</form>