What potential pitfalls should be considered when using eregi_replace to replace HTML tags with new line characters in PHP?
One potential pitfall when using eregi_replace to replace HTML tags with new line characters in PHP is that it is case-insensitive, which may lead to unintended replacements. To avoid this, you can use the preg_replace function with the 'i' modifier to make the replacement case-insensitive.
// Use preg_replace with the 'i' modifier to make the replacement case-insensitive
$newString = preg_replace('/<[^>]*>/i', "\n", $originalString);