Si je t'ai bien suivi Ajoloca, la meilleure méthode pour éviter cet inconvénient serait donc pour Arno, s'il est hébergé sur un serveur linux:
$tab = explode("\n", $_POST['ajout_ligne']);
Car
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8"/>
<title>ess.php</title>
</head>
<body>
<?php
$chaine="Première ligne\nune ligne vide\n\nune autre ligne\n";
$tab = explode("\n", $chaine);
echo '<pre>';
print_r($tab);
echo '</pre>';
?>
</body>
</html>
donne à l'exécution
Code : Tout sélectionner
Array
(
[0] => Première ligne
[1] => une ligne vide
[2] =>
[3] => une autre ligne
[4] =>
)