funciones
| From: | Carlos Carrera | Date: | Wed, 13 Nov 2002 16:10:26 +0000 |
| Subject: | funciones | ||
| Groups: | php.general.es | ||
| Request: | Send a blank email to general-es+get-29189@lists.php.net to get a copy of this message | ||
Amigos, una consulta, he hecho un programita en php y he aplicado funciones
dentro de la cual he declarado las variables:
func_num_arg()
func_get_arg() y
func_get_args()
pero cuando ejecuto el programita en mi apache linux el browser se queda en
blanco y no carga nada ni siquiera me muestra errores...
el programita es:
_______________
<?php
function listar($matriz)
{
echo "<table border=3>\n";
for ($i=0;$i < count($matriz); $i++)
{
echo "<tr>\n";
echo "<td>Elemento $i</td>\n";
echo "<td>$matriz[$i]</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
}
function media()
{
$limite=func_num_args();
$acumulado=0;
echo "<table width=175>\n";
echo "<caption align=top>Número de argumentos: $limite</caption>\n";
for ($i=0;Si<$limite;$i++)
{
echo "<tr>\n";
echo "<td align=center>Parámetros $i </td>\n";
echo "<td align=center>",func_get_arg($i),"</td>\n";
echo "</tr>\n";
$acumulado += func_get_arg($i);
}
echo "</tables>\n";
listar(func_get_args());
return $acumulado/$limite;
}
$valor_media = media(12, 13, 15);
echo "<h2>Valor de la Media: ", $valor_media, "</h2>\n";
?>
___________
Saludos...