close, i had a very similar set of expressions working that angle last night. but the important part is that I want to remove the empty keys (on unset them) and then save the array into a new array ONLY populated by keys/values with a non-blank value.
Ill give it a shot though.
Haji Hill wrote:
I'm not entirely sure what you're tryng to do, but take a look at this code it might be helpful....
foreach( $arrayname as $aKey => $aValue)
{
if(!empty($aValue))
{
$var_name = $aKey;
$$var_name = $aValue;
echo "$aKey = $aValue ";
};
};
I think this might be useful to you, it should work, though I did just edit it down to illustrate the idea. It should display only the filled values in the array, and their key names. Substitute the echo command with other instructions, but you knew that already.
Good Luck,
-Haji