Skip to content

Instantly share code, notes, and snippets.

@juliankoehn
Created May 5, 2019 06:55
Show Gist options
  • Save juliankoehn/215876a84f4a2c0ad3b4d9cf2cd93a9d to your computer and use it in GitHub Desktop.
Save juliankoehn/215876a84f4a2c0ad3b4d9cf2cd93a9d to your computer and use it in GitHub Desktop.
Simple UTF8 Converter Function (used for JTL -> Laravel (Latin1 to UTF8)
<?php
public function convertToUtf8 ($el) {
if (is_array($el)) {
foreach ($el as $key => $value) {
if (is_array($el[$key])) {
$el[$key] = $this->convertToUtf8($value);
} else {
$el[$key] = utf8_encode($value);
}
}
return $el;
} else {
return utf8_encode($el);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment