PHP utf8_encode() Function
In this chapter you will learn:
- Description for PHP utf8_encode() Function
- Syntax for PHP utf8_encode() Function
- Parameter for PHP utf8_encode() Function
- Return value for PHP utf8_encode() Function
- Example - Use utf8_encode
Description
The utf8_encode() function encodes an ISO-8859-1 string to UTF-8.
Syntax
PHP utf8_encode() Function has the following syntax.
utf8_encode(string)
Parameter
Parameter | Is Required | Description |
---|---|---|
string | Required. | String to encode |
Return
This function returns the encoded string on success, or FALSE on failure.
Example
<?PHP
echo utf8_encode("from java2s.com");
?>
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP vprintf() Function
- Syntax for PHP vprintf() Function
- Parameter for PHP vprintf() Function
- Additional format for PHP printf() Function
- Related functions
- Return for PHP vprintf() Function
- Example - Output a formatted string
- Example - Using the format value %f
- Example - Use of placeholders
Home » PHP Tutorial » PHP String Functions