{"id":4411,"date":"2022-09-29T16:46:35","date_gmt":"2022-09-29T15:46:35","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=4411"},"modified":"2022-09-29T16:46:36","modified_gmt":"2022-09-29T15:46:36","slug":"array-values","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/php\/forms\/array-values","title":{"rendered":"Array Values"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Creating a field that will give an array when submitted<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">Form element<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>  &lt;input type=\"checkbox\" name=\"PersonsSelected&#91;]\" value=\"$PersonUserId\" \/><\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Form handler<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>  $SelectedPersons = array();\r\n  if (isset($_POST&#91;'PersonsSelected']))\r\n  {\r\n    $SelectedPersons = $_POST&#91;'PersonsSelected'];\r\n        \r\n    foreach ($SelectedPersons as $SelectedPerson)\r\n    {\r\n      \/\/ = $SelectedPerson\r\n    }\r\n\r  }<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating a field that will give an array when submitted Form element Form handler<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42,44],"tags":[],"class_list":["post-4411","post","type-post","status-publish","format-standard","hentry","category-forms","category-forms-html"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/4411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=4411"}],"version-history":[{"count":1,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/4411\/revisions"}],"predecessor-version":[{"id":4412,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/4411\/revisions\/4412"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=4411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=4411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=4411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}