Yngvarr

Generation

generate functionTue, 21 Mar 2023

convert file to utf8

function file_to_utf8($file) { $contents = file_get_contents($file); $contents = mb_convert_encoding($contents, 'UTF-8', mb_detect_encoding($contents, 'UTF-8, ISO-8859-1', true)); file_put_contents($file, $contents); } file_to_utf8("/path/to/file");

Questions about programming?Chat with your personal AI assistant