Home >Backend Development >PHP Tutorial >Solution to Chinese garbled Chinese characters read by PHP
Example, solve the problem of Chinese garbled characters in the following program.
before garbled characters: 1:subwayLine1:?? 2: subwayLine1: ??? 3: subwayLine1: ??? 4: subwayLine1: ???? 5: subwayLine1: ???? The result after solving the Chinese garbled characters: 1: subwayLine1: Xinzhuang 2: subwayLine1: outer ring road 3: subwayLine1: Lotus Road 4: subwayLine1: Jinjiang Paradise 5: subwayLine1: Shanghai South Railway Station The main thing is this sentence: $link->query("SET NAMES 'UTF8'"); Specify default character encoding. |