MySQL Query to Remove HTML Tags
You have a substantial database filled with records containing HTML tags (). Removing these tags is essential. While PHP provides the strip_tags method, running a PHP script to modify all the records can be time-consuming.
MySQL Solution
MySQL version 5.5 and later offer XML functions that can address this issue:
SELECT ExtractValue(field, '//text()') FROM table;
This query extracts only the text content from the specified "field" column in the "table." It relies on the XML functions provided by MySQL to parse the HTML tags and retrieve the text content.
Reference
For more details on XML functions in MySQL, refer to the official documentation:
https://dev.mysql.com/doc/refman/5.5/en/xml-functions.html
以上是如何從 MySQL 資料庫中刪除 HTML 標籤?的詳細內容。更多資訊請關注PHP中文網其他相關文章!