mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-14 01:33:58 +02:00
made utf8mb4 consistently represented as code
This commit is contained in:
@@ -30,7 +30,7 @@ Finally, many PHP functions that operate on strings have an optional parameter l
|
||||
|
||||
If your PHP script accesses MySQL, there's a chance your strings could be stored as non-UTF-8 strings in the database even if you follow all of the precautions above.
|
||||
|
||||
To make sure your strings go from PHP to MySQL as UTF-8, make sure your database and tables are all set to the utf8mb4 character set and collation, and that you use the utf8mb4 character set in the PDO connection string. For an example, see the section on [connecting to and querying a MySQL database](https://phpbestpractices.org/#mysql). This is _critically important_.
|
||||
To make sure your strings go from PHP to MySQL as UTF-8, make sure your database and tables are all set to the `utf8mb4` character set and collation, and that you use the `utf8mb4` character set in the PDO connection string. For an example, see the section on [connecting to and querying a MySQL database](https://phpbestpractices.org/#mysql). This is _critically important_.
|
||||
|
||||
Note that you must use the `utf8mb4` character set for complete UTF-8 support, not the `utf8` character set! See Further Reading for why.
|
||||
|
||||
|
Reference in New Issue
Block a user