Chinese garbled php SQL Server

Basically stereotyped said Collocation online database settings and fields (character sets), indeed, this is necessary,

Key for phper, apart database character set and the field, but also need to specify the link to the database character set when the link to the database, as described in the document microsoft.

https://docs.microsoft.com/en-us/sql/connect/php/how-to-send-and-retrieve-utf-8-data-using-built-in-utf-8-support?redirectedfrom=MSDN&view=sql-server-ver15

To UTF-8 encoding of the data sent to the server or to retrieve:

1. Make sure that the type of the source or destination row or column is nchar nvarchar.

2.SQLSRV_PHPTYPE_STRING ( 'UTF-8') PHP type specified in the parameter array. Alternatively, designated "CharacterSet" => "UTF-8" as connection options.

 

Guess you like

Origin www.cnblogs.com/pianxiangongzi/p/11870742.html