mailparse_determine_best_xfer_encoding

(PECL mailparse >= 0.9.0)

mailparse_determine_best_xfer_encodingGets the best way of encoding

˵Ã÷

mailparse_determine_best_xfer_encoding ( resource $fp ) : string

Figures out the best way of encoding the content read from the given file pointer.

²ÎÊý

fp

A valid file pointer, which must be seek-able.

·µ»ØÖµ

Returns one of the character encodings supported by the mbstring module.

·¶Àý

Example #1 mailparse_determine_best_xfer_encoding() example

<?php

$fp 
fopen('somemail.eml''r');
echo 
'Best encoding: ' mailparse_determine_best_xfer_encoding($fp);

?>

ÒÔÉÏÀý³ÌµÄÊä³öÀàËÆÓÚ£º

Best encoding: 7bit

User Contributed Notes

ramoncin at hotmail dot com 11-Mar-2021 05:10
<?php
session_start
();
?>
<?php
$conexion
=mysqli_connect('192.168.2.201','proba','abc123.','senderismo') or die (mysqli_error($conexion));
if (
$conexion) {
    if (isset(
$_GET['c'])) {
       
$datos=mysqli_query($conexion,"SELECT * FROM material");
    }
    if (isset(
$_GET['m'])) {
       
$datos=mysqli_query($conexion,"SELECT * FROM material ORDER BY Marca");
    }
    if (isset(
$_GET['p'])) {
       
$datos=mysqli_query($conexion,"SELECT * FROM material ORDER BY Prezo");
    }
    if (isset(
$_GET['e'])) {
        if (isset(
$_GET['T']){
           
$type=$_GET['T']
           
$datos=mysqli_query($conexion,"SELECT * FROM material where Tipo like '$type$");
        }
    }
if (
$datos != FALSE) {
    while (
$fila=mysqli_fetch_array($datos)) {
       
$srcImaxe=$fila['Imaxe'].".jpg";
        echo
"<div class='produto'><img src='imaxes/$srcImaxe'><br>",$fila['Nome'],"<br>",
$fila['Marca'],"<br>",$fila['Tipo'],"<br>",$fila['Prezo'],"€<br></div>";
        }
    }
    echo
"<form action='ver.php' method='GET'
        <input type='submit' name='volta' value='Vovler atr¨¢s'<br>
        </form>"
;
}
else{
    echo
"Mal;"
}
?>
ver at gmail dot com 11-Mar-2021 05:07
<?php
session_start
();
?>
<?php
$conexion
=mysqli_connect('192.168.2.201','proba','abc123.','senderismo') or die (mysqli_error($conexion));
if (
$conexion) {
   
$usu1=$_GET['usu'];
   
$con1=$_GET['con'];
}
if ((
strcmp($usu1, "Eva")==0 || strcmp($usu1, "Xan")==0)&& strcmp($con1, "abc123.")==0 ){
   
$_SESSION['usu']=$usu1;
   
$_SESSION['con']=$con1;
    echo
"Benvido: ", $usu1;

    echo
"<form action='lista.php' method='GET'>
    <input type='submit' name='c' value='Listado Completo'><br>
    <input type='submit' name='m' value='Listado por Marca'><br>
    <input type='submit' name='p' value='Listado por prezo'><br>
    <select name='T'>
        <option name='Calcetin'>Calcetin</option>
        <option name='Pantalon'>Pantalon</option>
        <option name='Bota'>Bota</option>
        <option name='Chaqueta'>Chaqueta</option>
        <option name='Zapatilla'>Zapatilla</option>
            </select>
        <input type='submit' name='e' value='Enviar'><br>
    </form>"
;

    if (
strcmp($usu1, "Eva")==0{
        echo
"<input type='button' name='c' value='Engadir Rexistro'><br>
        <input type='button' name='m' value='Editar Rexistro'><br>
        <input type='button' name='p' value='Eliminar Rexistro'><br>"
;
    }
}
else {
    echo
"Non se puido conectar a BBDD";
}
?>
intro at gmail dot com 11-Mar-2021 05:05
<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
<form action="ver.php" method="GET">
    <p>Introduzca un Usuario:</p>
    <input type="text" name="usu"><br>
    <p>Introduzca un Contrasinal:</p>
    <input type="password" name="con"><br>
    <input type="submit" name="Enviar">
</form>
</body>
</html>
matej dot kovac at gmail dot com 20-Nov-2011 11:12
As of mailparse-2.1.5, it can return 7bit, 8bit, base64 and qprint. False on mbstring failure.
mileskeaton at gmail dot com 02-Jan-2009 11:16
As far as I can tell, this only returns one of two strings: 'Quoted-Printable' or '7bit'