perdida de datos en ciclo foreach con html
Publicado por juan (6 intervenciones) el 24/04/2018 04:32:55
estoy imprimiendo mis datos que traigo desde un web service, pero no entiendo porque cuando imprimo el codigo y el nombre no imprimen y cuando lo hago sin foreach si me aparecen.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php if(strcmp($error, $conver) == 0) : ?>
<p>"Error no ha diguitado ningun codigo para la busqueda"</p>
<p>Resultado de la busqueda por Codigo</p>
<?php else : $xml_t = simplexml_load_string($result['return']); ?>
<table border="1">
<tr>
<th>ID</th>
<th>Codigo Materia</th>
<th>Nombre Materia</th></th>
<th>Descripcion Materia</th>
</tr>
<?php foreach($xml_t ->Materia as $materia): ?>
<tr>
<td><?php print $materia->id; ?></td>
<td><?php print $materia->codigo_materia; ?></td>
<td><?php print $materia->nombre_materia; ?></td>
<td><?php print $materia->desc__materia; ?></td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
Valora esta pregunta


0