ejemplo
a->5
b->4
c->8
etc...
Este es mi codigo, pero ala hora de hacer el foreach me sale error en el arreglo,
me podrian ayudar xfa??
Código PHP:
$str = file_get_contents('archivo2.txt');
$str = trim($str);
$str = preg_replace("/\s\s+/", ' ', $str);
$str = strtolower($str);
echo "Hay ". $count=strlen($str). " letras: "."<br>";
echo '<table><tr><th>letra</th></tr>';
//AQUI ES DONDE HAGO EL FOREACH PARA CONTAR CUANTAS VECES SE REPITE CADA CARACTER
for($i=0;$i<strlen($str);$i++)
{
//echo '<tr><td>' . $str[$i] . '</td></tr>'; //qui ya me separa las letras
if (! array_key_exist($str, $miarray))$dd[$one]= 1;
else $add[$one] +=1;
}
echo '</table>';