I have following code snippet but i dont understand what its do, but i think there is easy way to write this code again with a simple foreach like below, is that correct ?
$paypal_message="";
while( @list($key,$value) = @each($paypal_post_vars)) {
$paypal_message .= $key.":\t".$value."
";
if($key!='custom'){
$insert_sql.=" `".$key."`='".$value."' , ";
}
}
I think rewrite it like this ? is it exactly the same ?
foreach($paypal_post_vars as $key=>$value ){
$paypal_message .= $key.":\t".$value."
";
if($key!='custom'){
$insert_sql.=" `".$key."`='".$value."' , ";
}
}