hola tengo el siguiente codigo
Código PHP:
Ver original<?php
include("conexion.php");
$con = conectar();
$fecha1 = $_POST['date1'];
$fecha2 = $_POST['date2'];
$codigo = $_POST['codigo']; // campaña
header('Content-type: application/vnd.ms-excel');//vnd.ms-excel $h = "3";
$hm = $h * 60;
$ms = $hm * 60;
$can_dias = 1;
$fec_vencimi= date("Y/m/d", strtotime("$fecha2 + $can_dias days")); $fecha = "detalle" . gmdate("Gis_Ymd", time()-($ms)); header("Content-Disposition: filename=\"$fecha.xls\";");
$sql = "select calldate,dst from cdr
where billsec = 0 and dst like '$codigo' and calldate between '$fecha1' and '$fec_vencimi'";
echo "<table border='1'>";
echo "<tr>";
echo "<td><b>Codigo</b></td>";
echo "<td><b>Fecha</b></td>";
echo "<tr>";
for($j=0; $j<$columnas; $j++){
echo "<td>".$resultado."</td>";
}
echo "</tr>";
}
echo "</table>";
?>
lo cual funciona bien hasta cierot punto, ya qu een la consulta asocio loos 2 campos de mi BD y quiro cortar el campo DST del 7 caracter hacia adelante osea
1234567890 y que me imprima 890 lo cual lo hace pero con este codigo me corta los campos de mi BD