$text = "This is a sample text.\nIt has multiple\nlines"; $formattedText = t3lib_div::formatForTextarea($text); echo "";
$text = "This is a bold text"; $formattedText = t3lib_div::formatForTextarea($text, true); echo "";In this example, we have a string that contains HTML tags. We call the formatForTextarea function with a second argument set to true. This tells the function to encode the HTML tags so that they are displayed as plain text inside the textarea. Based on the function name and the usage of the t3lib_div library, we can determine that this function is part of the TYPO3 CMS library. The t3lib_div library is one of the core libraries of TYPO3 CMS and is used for various functions that are not specific to any one module of the system.