Tema: Contador Php
Ver Mensaje Individual
  #5 (permalink)  
Antiguo 26/08/2011, 10:21
maxedrom
 
Fecha de Ingreso: mayo-2010
Mensajes: 13
Antigüedad: 13 años, 11 meses
Puntos: 0
Respuesta: Contador Php

Bueno ahi lo cree.

////
$fp = fopen("numeros.txt" , "a+");
for($i = 0; $i< 10 ; $i++)
{
$numero_aleatorio = rand(1 , 9);
fputs($fp , $numero_aleatorio);

}
fclose($fp);

y en otro cree esto

$contenido = file_get_contents("numeros.txt");
preg_match_all("#5#si",$contenido , $numeros);
$total_cinco = count($numeros[1]);
print "Hay $total_cinco numeros 5 ";

a mi entender tendria que funcionar, pero no me devuelve ningun valor... porque podra ser?