What are some common mistakes to avoid when working with HTML textarea elements in PHP?

One common mistake when working with HTML textarea elements in PHP is not properly escaping user input before displaying it in the textarea. This can lead to security vulnerabilities such as cross-site scripting (XSS) attacks. To avoid this, always use functions like htmlspecialchars() to escape user input before outputting it in the textarea.

<textarea><?php echo htmlspecialchars($user_input); ?></textarea>