{"id":293,"date":"2010-07-14T08:38:24","date_gmt":"2010-07-14T12:38:24","guid":{"rendered":"http:\/\/erics-test-lab.com\/?p=293"},"modified":"2010-07-14T08:38:24","modified_gmt":"2010-07-14T12:38:24","slug":"looping-over-arrays","status":"publish","type":"post","link":"https:\/\/www.esearing.com\/v2010\/2010\/07\/looping-over-arrays\/","title":{"rendered":"looping over Arrays"},"content":{"rendered":"<p>Yippee we can now easily loop over arrays in CF8.<\/p>\n<p><code>&lt;cfloop array=\"arrayname\" index=\"i\"&gt;<br \/>\n&lt;cfoutput&gt;#i#&lt;\/cfoutput&gt;<br \/>\n&lt;\/cfloop&gt;<\/code><\/p>\n<p>#i# will show us the values in the array. You can ofcourse apply logic to the output so that dates an numbers are formatted.<br \/>\n<!--more--><br \/>\nConsider this array for a contact application.<br \/>\nBob, Jones, 123 mainstreet, anytown, ST, USA, 555-123-4567, 14-NOV-1963.<br \/>\nFirsname, lastname, address, city, state, country, phone, birthdate.<\/p>\n<p><code>&lt;cfloop array=\"arrayname\" index=\"i\"&gt;<br \/>\n&lt;cfoutput&gt;<br \/>\n&lt;cfif isDate(i)&gt;#dateformat(i,\"mm\/dd\/yyyy\")#<br \/>\n&lt;cfelse&gt; #i#<br \/>\n&lt;cfif&gt;<br \/>\n&lt;\/cfoutput&gt;<br \/>\n&lt;\/cfloop&gt;<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yippee we can now easily loop over arrays in CF8. &lt;cfloop array=&#8221;arrayname&#8221; index=&#8221;i&#8221;&gt; &lt;cfoutput&gt;#i#&lt;\/cfoutput&gt; &lt;\/cfloop&gt; #i# will show us the values in the array. You can ofcourse apply logic to the output so that dates an numbers are formatted.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,16,24],"tags":[],"class_list":["post-293","post","type-post","status-publish","format-standard","hentry","category-code","category-coldfusion","category-snippets-quick-code-tips-for-single-elements-attributes-or-details"],"_links":{"self":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/293","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/comments?post=293"}],"version-history":[{"count":0,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/293\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/media?parent=293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/categories?post=293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/tags?post=293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}