![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
05/02/2010, 00:29
|
| | Fecha de Ingreso: febrero-2010
Mensajes: 4
Antigüedad: 15 años Puntos: 0 | |
Ayuda x favor!!! Amigos alguno me podria ayudar a corregir este error:
Este es el codigo del q me tira el error: <?php
$productos=array(array("A","Action",100),
array("P","Photo",18),
array("F","Flash",40));
echo $productos[2][2];
function compara($x,$y)
{
if($x[2]==$y[2])
return 0;
else if ($x[2]< $y[2])
return -1;
else
return 1;
}
usort ($productos,compara);
echo $productos[2][2];
?>
Y este es el error: 40
Notice: Use of undefined constant compara - assumed 'compara' in C:\wamp\www\Macho\php11\vt11\usort2.php on line 18
100
Se le agradece a todos su colaboracion, Muchas Gracias!!!!
Y tambien en otro codigo me tiran errores parecidos ejem: Notice: Use of undefined constant Cod - assumed 'Cod' in C:\wamp\www\Macho\php10\practicas\array8.php on line 4
Notice: Use of undefined constant Descrip - assumed 'Descrip' in C:\wamp\www\Macho\php10\practicas\array8.php on line 5
Notice: Use of undefined constant precio - assumed 'precio' in C:\wamp\www\Macho\php10\practicas\array8.php on line 6 |