Title: posted_data returns &#8220;Array&#8221;
Last modified: June 10, 2021

---

# posted_data returns “Array”

 *  Resolved [crafto](https://wordpress.org/support/users/crafto/)
 * (@crafto)
 * [5 years ago](https://wordpress.org/support/topic/posted_data-returns-array/)
 * Hello everyone, after resolving one problem, there’s always an other one hiding
   behind haha (but not on the same scale at least).
 * So before you tell me this, I know there was a topic about the same subject :
   [https://wordpress.org/support/topic/get_posted_data-return-array-and-not-selected-value-in-dropdown-select/](https://wordpress.org/support/topic/get_posted_data-return-array-and-not-selected-value-in-dropdown-select/)
   
   But it didn’t helped me for my case and I couldn’t find anything on the web after
   browsing for 20~30 mins (either my research are very bad or there’s nothing) 
   and this topic got left for now 7 months ago.
 * So in my case, the problem is when I’m sending an email via my php function here:
 *     ```
       function action_wpcf7_before_send_mail( $contact_form ){
       	if($form_id = 11057){
             $submission = WPCF7_Submission::get_instance();
             $posted_data = $submission->get_posted_data();
             if( $posted_data['checkbox'][0] ) {
       				$to = $posted_data['email'];
       				$subject = "Meeting recap";
       				$message .= "Date and Time of the meeting: ".$posted_data['radio']." à ".$posted_data['hour']."h
       ```
   
 * For the $posted_data[‘radio’] and the $posted_data[‘hour’], I’m having “Array”
   written in the body message instead of what the user select.
 * The $posted_data[‘radio’] is from a radio tag of course, as for the [‘hour’] 
   one, it’s from a select tag. I also don’t understand why the radio returns me
   an array when it is not one.
 * Hope I was clear with what I want and my explanation, thank you in advance for
   your replies!

Viewing 1 replies (of 1 total)

 *  Thread Starter [crafto](https://wordpress.org/support/users/crafto/)
 * (@crafto)
 * [5 years ago](https://wordpress.org/support/topic/posted_data-returns-array/#post-14542551)
 * Yeah, like I said, my research was bad haha. I found the solution on this topic
   here :
    [https://wordpress.org/support/topic/dropdowns-returned-as-array/](https://wordpress.org/support/topic/dropdowns-returned-as-array/)
 * By referencing the zero key to my $posted_data[‘radio’] and [‘hour’] I can get
   their values.
 * Written this way : $posted_data[‘radio’][0] / $posted_data[‘hour’][0]

Viewing 1 replies (of 1 total)

The topic ‘posted_data returns “Array”’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [crafto](https://wordpress.org/support/users/crafto/)
 * Last activity: [5 years ago](https://wordpress.org/support/topic/posted_data-returns-array/#post-14542551)
 * Status: resolved