Themosis框架集合循环

我已经使用Themosis已有一段时间了, 对” Collection” 元字段还是陌生的。
我从[type => ” image” ]的集合中检索了以下元数据:

a:9:{i:0; s:4:"1892"; i:1; s:4:"1891"; i:2; s:4:"1890"; i:3; s:4:"1888"; i:4; s:4:"1887"; i:5; s:4:"1886"; i:6; s:4:"1885"; i:7; s:4:"1884"; i:8; s:4:"1883"; }

【Themosis框架集合循环】此外, 我知道i =索引, 并且引用的数字是图像附件ID。在任何情况下, a:9和s:4是什么?
我似乎找不到任何有关如何通过如上所述的元数据遍历集合的Themosis文档。
#1这是你的序列化数组, 需要先实现此数组, 然后才能实现。
a:9:{i:0; s:4:"1892"; i:1; s:4:"1891"; i:2; s:4:"1890"; i:3; s:4:"1888"; i:4; s:4:"1887"; i:5; s:4:"1886"; i:6; s:4:"1885"; i:7; s:4:"1884"; i:8; s:4:"1883"; }

你可以使用unserialize()函数来完全完成你的成就。
#2我从未真正想到过对数据进行序列化和反序列化。但是, 这对我有用:
< ?php $images = isset($meta['gallery']) ? unserialize(reset($meta['gallery'])) : false; ?> @if($images & & !empty($images)) @foreach($images as $key => $img) // Do the things here @endforeach @endif

    推荐阅读