Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/06/2015, 22:40
Avatar de enlinea777
enlinea777
 
Fecha de Ingreso: mayo-2008
Ubicación: frente al pc
Mensajes: 1.830
Antigüedad: 16 años
Puntos: 127
Respuesta: Undefined Offset 4

Bueno pues al parecer vienes del mundo visual basic, asp o .net
en php cuando algo no funciona bien se debuguea para poder ver el error asi que te aconsejo hacer eso.
este es un ejemplo de debuguear.
Código PHP:
do {

        if (isset(
$a[$i],$r[$j])?($a[$i] < $r[$j]):0) {
            
$x[$i][$j] = $a[$i];
            
$r[$j] = $r[$j] - $a[$i];
            
$a[$i] = 0;
            
$i++;
            
$count++;
        } else if (isset(
$a[$i],$r[$j])?($a[$i] > $r[$j]):0) {
            
$x[$i][$j] = $r[$j];
            
$a[$i] = $a[$i] - $r[$j];
            
$r[$j] = 0;
            
$j++;
            
$count++;
        } else {
            
            
var_dump($x[$i][$j]); // SI LA LINEA DE ABAJO DA ERROR PUES VE QUE HAY ANTES DE QUE SE CAIGA EN EL
            
$x[$i][$j] = $a[$i];//aqui me marca el error de undefine offset 4
            
$a[$i] = 0;
            
$r[$j] = 0;
            
$i++;
            
$j++;
            
$count++;
        }
    } while (
$count <= $o $d 1);