I have problem with function , if i use the script and no works as function works fine , but if use it as function no works me and no show the values right , for example with the function show me only 1 value and if don´t use as function show me all values right , i don´t know if the problem it´s with arrays inside function or what
<?php
function update($array_1)
{
$val=explode(","$array_1);
foreach ($val as $key=>$value)
{
$values_db[]="".$key."";
}
foreach($_POST['opt'] as $key2=>$value2)
{
$values_post[]="".$key2."";
}
$aa=array_diff($values_db,$values_post);
$bb=array_intersect($values_db,$values_post);
foreach($aa as $aaa)
{
print "<b>".$aaa." ".$opt[$aaa]."</b><br>";
}
foreach($bb as $bbb)
{
print "".$bbb." ".$_POST['opt'][$bbb]."<br>";
}
}
update("val1,val2");
?>
The problem it´s if use as function only , i think if howewer the values i send by POST in function no works fine and if use the script as no function receive ok
Regards