Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将数组的输出保存在 smarty tpl 的隐藏 div 中。我曾经{$product|@print_r}这样做过。但我希望该数组被序列化。有没有办法获得序列化$product数组。请帮忙。
{$product|@print_r}
$product
你试过 {$product|@serialize} 吗?
序列化的最佳实践:
//serialize $string = base64_encode(serialize($array)); //unserialize $array = unserialize(base64_decode($string));