mailparse_determine_best_xfer_encoding

(PECL mailparse >= 0.9.0)

mailparse_determine_best_xfer_encodingGets the best way of encoding

Description

mailparse_determine_best_xfer_encoding(resource $fp): string

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

Parameters

fp

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

Return Values

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

Examples

Example #1 mailparse_determine_best_xfer_encoding() example

<?php

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

?>

The above example will output something similar to:

Best encoding: 7bit

add a note

User Contributed Notes 5 notes

up
-2
ramoncin at hotmail dot com
3 years ago
<?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;"
}
?>
up
-3
ver at gmail dot com
3 years ago
<?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";
}
?>
up
-3
intro at gmail dot com
3 years ago
<!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>
up
-4
matej dot kovac at gmail dot com
12 years ago
As of mailparse-2.1.5, it can return 7bit, 8bit, base64 and qprint. False on mbstring failure.
up
-4
mileskeaton at gmail dot com
15 years ago
As far as I can tell, this only returns one of two strings: 'Quoted-Printable' or '7bit'
To Top