mysql_client_encoding
(PHP 4 >= 4.3.0, PHP 5, PECL mysql:1.0)
mysql_client_encoding — Returnerer det nuværende tegnsæt
Beskrivelse
string mysql_client_encoding
([ resource $link_identifier
] )
Henter character_set variablen fra MySQL.
Parameterliste
- link_identifier
-
The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect() is assumed. If no such link is found, it will try to create one as if mysql_connect() was called with no arguments. If by chance no connection is found or established, an E_WARNING level warning is generated.
Returneringsværdier
Returnerer standard tegnsættet fra den nuværende, aktive forbindelse.
Eksempler
Example#1 mysql_client_encoding() eksempel
<?php
$link = mysql_connect('localhost', 'mysql_bruger', 'mysql_kode');
$charset = mysql_client_encoding($link);
echo "Det nuværende tegnsæt er: $charset\n";
?>
Ovenstående eksempel vil udskrive noget der ligner:
Det nuværende tegnsæt er: latin1