How to Produce UTF-8 Characters in PHP
The PHP "utf8_encode" function lets you encode and display UTF-8 characters from your dynamic Web pages. The function encloses any string character to use UTF-8 encoding on your Web pages. The UTF-8 standard is a type of encoding that stores character recognition in the computer bytes used in computer programming.
Instructions
-
-
1
Right-click the PHP file that you want to use to display UTF-8 characters. Click "Open With," then click your PHP editor.
-
2
Create a character string if you do not already have a string defined. The following code creates a string in PHP:
$string = "this is my string";
-
-
3
Add the "utf8_encode" function to encode the characters and display the data on the Web page. The following code encodes the string created in Step 2:
echo utf8_encode($string);
-
1