Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/11/2013, 14:08
Avatar de Simon_Echecopar
Simon_Echecopar
 
Fecha de Ingreso: marzo-2012
Mensajes: 96
Antigüedad: 12 años, 1 mes
Puntos: 0
XML+php+html5

Tengo el siguiente codigo y me sale Resource id#3.

Código PHP:
<?php
$dir 
"XMLImagen/";       //Especifica el directorio a leer
$rep opendir($dir);  //Abrimos el directorio
echo $dir;
echo 
"<br/>".$rep."<br />";
while ((
$arc readdir($rep)) !== FALSE
{
//while 
 //Leemos el arreglo de archivos contenidos en el directorio: readdir recibe como parametro el directorio abierto
 //echo $arc."<br />";
 
if($arc != '..' && $arc !='.' && $arc !='')
 {
//if1 
  //echo "<a href=".$dir.$arc." target='_blank'>".$arc."</a><br />"; //Imprimimos el nombre del archivo con un link
  
$fecha date("mY").".xml";
  
$bin=substr($arc,11);
  if(
$bin==$fecha)
  {
//if2 
   
$xml file_get_contents($dir.$arc);
   
$DOM = new DOMDocument('1.0''utf-8');
   
$DOM->loadXML($xml);
   
$cursos $DOM->getElementsByTagName('elemento');
   foreach(
$cursos as $curso
   {
//if3 
    //echo $arc."<br />";
    //var_dump($cursos);
    
echo $curso;
    echo 
'<ul class="posicion"><li><img class="imagen1" src="'.utf8_decode($curso->getElementsByTagName("archivo")->item(0)->nodeValue).'"></li><li><a class="titagenda">'.utf8_decode($curso->getElementsByTagName("titulo")->item(0)->nodeValue).'</a><br /><a class="agenda">'.utf8_decode($curso->getElementsByTagName("fecha")->item(0)->nodeValue).": ".utf8_decode($curso->getElementsByTagName("descripcion")->item(0)->nodeValue).'</a></li></ul>';
    }
//if3
   
}//if2

  
}//if1
}//while
   
closedir($rep);         //Cerramos el directorio
   
clearstatcache();
?>