1
Privet.
Dopustim est funktiya, kotoraya otobrajaet v browsere dannie posle vvideniya ih v pole. Est u kogo nibud idei dalshe?
// these lines format the output as HTML comments
// and call dump_array repeatedly
echo "\\n\\n\\n";
echo "\\n";
echo "\\n";
echo "\\n";
echo "\\n";
echo "\\n";
echo "\\n";
echo "\\n";
echo "\\n";
echo "\\n\\n";
// dump_array() takes one array as a parameter
// It iterates through that array, creating a string
// to represent the array as a set
function dump_array($array)
{
if(is_array($array))
{
$size = count($array);
$string = "";
if($size)
{
$count = 0;
$string .= "{ ";
// add each element\'s key and value to the string
foreach($array as $var => $value)
{
$string .= "$var = \'$value\'";
if($count++ < ($size-1))
{
$string .= ", ";
}
}
$string .= " }";
}
return $string;
}
else
{
// if it is not an array, just return it
return $array;
}
}
Spasibo poka.
Dopustim est funktiya, kotoraya otobrajaet v browsere dannie posle vvideniya ih v pole. Est u kogo nibud idei dalshe?
// these lines format the output as HTML comments
// and call dump_array repeatedly
echo "\\n\\n\\n";
echo "\\n";
echo "\\n";
echo "\\n";
echo "\\n";
echo "\\n";
echo "\\n";
echo "\\n";
echo "\\n";
echo "\\n\\n";
// dump_array() takes one array as a parameter
// It iterates through that array, creating a string
// to represent the array as a set
function dump_array($array)
{
if(is_array($array))
{
$size = count($array);
$string = "";
if($size)
{
$count = 0;
$string .= "{ ";
// add each element\'s key and value to the string
foreach($array as $var => $value)
{
$string .= "$var = \'$value\'";
if($count++ < ($size-1))
{
$string .= ", ";
}
}
$string .= " }";
}
return $string;
}
else
{
// if it is not an array, just return it
return $array;
}
}
Spasibo poka.