Ver Mensaje Individual
  #5 (permalink)  
Antiguo 25/03/2010, 20:21
Avatar de MaTyS
MaTyS
 
Fecha de Ingreso: enero-2009
Ubicación: Mar del Plata
Mensajes: 220
Antigüedad: 15 años, 4 meses
Puntos: 18
Respuesta: Necesito copiar en 500 carpetas 1 mismo archivo. Como lo hago?

El codigo de pato12 me sirvio.
Pero pateketrueke me dio esta función:

Código PHP:
Ver original
  1. (23:16) Alvaro: algo asi te sirve?
  2. function copia_masiva($archivo, $ruta)
  3. {
  4.   $contenido = file_get_contents($archivo);
  5.   $nombre = basename($archivo);
  6.   $tmp = opendir($ruta);
  7.   while ($old = readdir($tmp))
  8.   {
  9.     if ($old != '.' && $old != '..')
  10.     {
  11.       $new = $ruta . DIRECTORY_SEPARATOR . $old;
  12.       if (is_dir($new))
  13.       {
  14.         copy($archivo, $new . DIRECTORY_SEPARATOR . $nombre);
  15.       }
  16.     }
  17.   }
  18. }

Espero que les sirvan, ya pueden cerrar el tema.
Saludos.