What are the potential pitfalls of using textarea() function in PHP for form fields?

One potential pitfall of using the textarea() function in PHP for form fields is that it does not escape user input, leaving the application vulnerable to cross-site scripting (XSS) attacks. To mitigate this risk, it is important to properly sanitize and validate user input before displaying it in a textarea field.

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