-
- //Encoding conversion function
- function utf8togb($s) {
- return iconv('utf-8', 'gbk//IGNORE', $s); // The IGNORE parameter is Ignore characters that cannot be converted
- }
- //It is recommended to replace all Chinese fields with English aliases to facilitate the following operations and encoding conversion and other issues
- $sql="SELECT [id], [column] as typeid, [topic] as title, [author] as author, convert(text, [text]) as body FROM [article table];";
- $sql = utf8togb($sql);
- ?>
Copy code
|