setting charset using ini_set
This commit is contained in:
parent
3c27278e30
commit
c95472f079
2 changed files with 7 additions and 14 deletions
16
index.php
16
index.php
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
ini_set('mbstring.internal_encoding', 'UTF-8');
|
||||
|
||||
//Database & secrets
|
||||
use chillerlan\QRCode\QRCode;
|
||||
use Mpdf\Mpdf;
|
||||
|
@ -118,7 +120,7 @@ $data = '<!doctype html>
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="td_desc">Name</td>
|
||||
<td>' . sonderzeichen($row2["first_name"]) . " " . sonderzeichen($row2["last_name"]) . '</td>
|
||||
<td>' . $row2["first_name"] . " " . $row2["last_name"] . '</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="td_desc">Bestelldatum</td>
|
||||
|
@ -169,15 +171,3 @@ try {
|
|||
} catch (MpdfException $ex) {
|
||||
echo 'Exception abgefangen: ', $ex->getMessage(), "\n<br/>";
|
||||
}
|
||||
|
||||
function sonderzeichen($string): string
|
||||
{
|
||||
$res = $string;
|
||||
$res = str_replace("ä", "ae", $res);
|
||||
$res = str_replace("ü", "ue", $res);
|
||||
$res = str_replace("ö", "oe", $res);
|
||||
$res = str_replace("Ä", "Ae", $res);
|
||||
$res = str_replace("Ü", "Ue", $res);
|
||||
$res = str_replace("Ö", "Oe", $res);
|
||||
return str_replace("ß", "ss", $res);
|
||||
}
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
|
||||
ini_set('mbstring.internal_encoding', 'UTF-8');
|
||||
|
||||
|
||||
//Database & secrets
|
||||
|
||||
include "config.php";
|
||||
|
|
Loading…
Reference in a new issue