Ok, i made this function which seems to be craping out on me. It's causing my server to work overtime and it's not doing what it is supposed to be. Basically it outputs an array as a form to verify items. Here is the function.
function echo_array( $item, $prefix ) {
$keys = array_keys( $item );
for ($x = 0; $x < sizeof( $item ); $x++) {
if (is_array($item[ $keys[ $x ] ])) {
echo_array( $item, $prefix.'[ '.$keys[ $x ].' ]');
} else {
echo '<input type="hidden" name="'.$prefix.'[ '.$keys[ $x ].' ]" value="'.$item[ $keys[ $x ] ].'">';
echo "\n";
}
}
return true;
}
It's called in the code like this:
echo_array( $item, "item" );
and the array content is as follows:
Array
(
[name] => the all seeing eye
[title] => all seeing eye
[keywords] => eye
[value] => 3000000
[type] => neck
[melee] =>
[range] =>
[distance] =>
[location] =>
[attributes] => Array
(
[lvl] => 80
[int] => 100
)
[bonus] => Array
(
[hit] => +4
[dam] => +6
[hp] => +200
)
[class] => Array
(
[tier] => 1
[noj] => 1
[wiz] => 1
)
)
If i where to add a if ($prefix != "item") die(); line right above where it does the recurtion, it ends the functions fine and is displays what it's supposed to untill that point.
I could use some help here so i dont get kicked off my server lol.
Thanks.