hsaenz12 Posted November 6, 2009 Share Posted November 6, 2009 I have this $p_number = $_POST['Req_number']; //which is an array of values from a form I need something like this $body = $prefix."\n".$name.' <'.$email.'>'."\r\n\r\n".stripslashes($body)."\r\n\r\n".stripslashes($p_number); $mail->setBody ( $body ); but $p_number returns "array" in the email body. How can I print the values of the array in the $body variable???? Quote Link to comment Share on other sites More sharing options...
lemmin Posted November 6, 2009 Share Posted November 6, 2009 You have to iterate through the values: $body = $prefix."\n".$name.' <'.$email.'>'."\r\n\r\n".stripslashes($body)."\r\n\r\n"; foreach ($p_number as $n) $body .= stripslashes($n) . ","; Quote Link to comment Share on other sites More sharing options...
hsaenz12 Posted November 6, 2009 Author Share Posted November 6, 2009 Thank you Lemmin. What if i have this $p_number = $_POST['Req_number']; $p_value = $_POST['Req_value']; and want something like this foreach ($p_value as $v) foreach ($p_number as $n) $body .= stripslashes($n) .stripslashes($v) . ","; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.