utf8_encode 


TRANSLATES an  ISO-8859-1  string to  UTF-8 .

Inverse function of  utf8_decode .





This function integrates the cast of  standard  library functions.

Included in this section for being in common use.



<?php

str utf8_encode 
str $data )


where,

$data An ISO-8859-1 STRING

?>

  $data   


An ISO-8859-1 STRING.



 NOTE FROM php.net about utf8_encode 


This function will not convert such Windows-1252 characters correctly.

Use a different function if Windows-1252 conversion is required.

Many web pages marked as using the ISO-8859-1 character encoding actually use the similar Windows-1252 encoding, and web browsers will interpret ISO-8859-1 web pages as Windows-1252.



  1 EXERCISE   

<?php

$airp02 
'São Paulo/Guarulhos, Governador André Franco Montoro International Airport, (IATA: GRU, ICAO: SBGR), often referred to as GRU Airport, or simply GRU, is the primary international airport serving São Paulo. It is popularly known locally as either Cumbica Airport, after the district where it is located and the Brazilian Air Force base that still exists at the airport complex, or Guarulhos Airport, after the municipality of Guarulhos, in the São Paulo, where it is located. Since November 28, 2001 the airport has been named after André Franco Montoro, (1916-1999), former Governor of São Paulo state. The airport was rebranded as GRU Airport in 2012. In Brazil the airport was ranked first in terms of transported passengers, aircraft operations, and cargo handled in 2012, placing it as the second busiest airport in Latin America by passenger traffic, (36,596,326 in 2016), after Mexico City International Airport. Guarulhos has slot restrictions, operating with a maximum of 45 operations/hour and being one of the five airports with such restrictions in Brazil (the others are São Paulo-Congonhas, Brasília, Belo Horizonte-Pampulha and Rio de Janeiro-Santos Dumont). Since 2012, the airport has been operated by a consortium composed of Invepar S/A, Airports Company South Africa, and Infraero. Some of its facilities are shared with the São Paulo Air Force Base of the Brazilian Air Force.';

$ISO8859enc utf8_encode($airp02);

echo 
$ISO8859enc;

?>

 RESULT   

 ISO-8859-1 

São Paulo/Guarulhos, Governador André Franco Montoro International Airport, (IATA: GRU, ICAO: SBGR), often referred to as GRU Airport, or simply GRU, is the primary international airport serving São Paulo. It is popularly known locally as either Cumbica Airport, after the district where it is located and the Brazilian Air Force base that still exists at the airport complex, or Guarulhos Airport, after the municipality of Guarulhos, in the São Paulo, where it is located. Since November 28, 2001 the airport has been named after André Franco Montoro, (1916-1999), former Governor of São Paulo state. The airport was rebranded as GRU Airport in 2012. In Brazil the airport was ranked first in terms of transported passengers, aircraft operations, and cargo handled in 2012, placing it as the second busiest airport in Latin America by passenger traffic, (36,596,326 in 2016), after Mexico City International Airport. Guarulhos has slot restrictions, operating with a maximum of 45 operations/hour and being one of the five airports with such restrictions in Brazil (the others are São Paulo-Congonhas, Brasília, Belo Horizonte-Pampulha and Rio de Janeiro-Santos Dumont). Since 2012, the airport has been operated by a consortium composed of Invepar S/A, Airports Company South Africa, and Infraero. Some of its facilities are shared with the São Paulo Air Force Base of the Brazilian Air Force.

 UTF-8 

São Paulo/Guarulhos, Governador André Franco Montoro International Airport, (IATA: GRU, ICAO: SBGR), often referred to as GRU Airport, or simply GRU, is the primary international airport serving São Paulo. It is popularly known locally as either Cumbica Airport, after the district where it is located and the Brazilian Air Force base that still exists at the airport complex, or Guarulhos Airport, after the municipality of Guarulhos, in the São Paulo, where it is located. Since November 28, 2001 the airport has been named after André Franco Montoro, (1916-1999), former Governor of São Paulo state. The airport was rebranded as GRU Airport in 2012. In Brazil the airport was ranked first in terms of transported passengers, aircraft operations, and cargo handled in 2012, placing it as the second busiest airport in Latin America by passenger traffic, (36,596,326 in 2016), after Mexico City International Airport. Guarulhos has slot restrictions, operating with a maximum of 45 operations/hour and being one of the five airports with such restrictions in Brazil (the others are São Paulo-Congonhas, Brasília, Belo Horizonte-Pampulha and Rio de Janeiro-Santos Dumont). Since 2012, the airport has been operated by a consortium composed of Invepar S/A, Airports Company South Africa, and Infraero. Some of its facilities are shared with the São Paulo Air Force Base of the Brazilian Air Force.