<?php
$DOM = new DOMDocument;
$DOM->loadHTML("<table>
<tr>
<td>Fecha</td>
<td>Documento</td>
<td>Descripci�³n</td>
<td>Transacci�³n</td>
<td>Oficina</td>
<td>Valor Cheque</td>
<td>Valor Total</td>
</tr>
<tr>
<td>31/01/2014</td>
<td>36713</td>
<td>0</td>
<td>Deposito Especial</td>
<td>UNICENTRO PEREIRA </td>
<td> $ ,00</td>
<td> $ 200.000,00</td>
</tr>
<tr>
<td>31/01/2014</td>
<td>140131</td>
<td>Cuota De Manejo Tarjeta Davilinea.</td>
<td>Nota D�©bito</td>
<td>UNICENTRO PEREIRA </td>
<td> $ ,00</td>
<td> $ 9.500,00</td>
</tr>
</table>");
$items = $DOM->getElementsByTagName('tr');
$doc = array();
function tdrows($elements)
{
$array = array();
foreach ($elements as $element)
{
array_push($array, $element->nodeValue);
}
return $array;
}
foreach ($items as $node)
{
array_push($doc, tdrows($node->childNodes));
}
unset($doc[0]);
foreach($doc as $i) {
$fecha = strtotime($i[0]);;
$documento = $i[1];
$descripcion = $i[2];
$transaccion = $i[3];
$oficina = $i[4];
$money = $i[6];
$s = preg_replace('|[^0-9]|i', '', $money);
$n = (int) $s;
$valor = $n;
$sql="INSERT INTO consiliacion(fecha,documento,oficina,descripcion,referencia,valor,estado,banco) VALUES ('%i','%s','%s','%s','%s','%d',0,6)";
$sql=sprintf($sql, $fecha, $documento, $oficina, $descripcion, $transaccion, $valor);
?>
- Output for 5.4.0 - 5.4.26
- Parse error: syntax error, unexpected end of file in /in/7R5OR on line 62
Process exited with code 255. - Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.28
- Parse error: syntax error, unexpected $end in /in/7R5OR on line 62
Process exited with code 255. - Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
- Parse error: parse error, unexpected $ in /in/7R5OR on line 62
Process exited with code 255. - Output for 4.3.2 - 4.3.4
- Parse error: parse error in /in/7R5OR on line 62
Process exited with code 255.
preferences:
196.77 ms | 1395 KiB | 116 Q