还有 php foreach 的其他示例吗?
我正在寻找与以下代码类似的另一个 php foreach 代码示例:
foreach ($this->ask->post['books'] as $book) {
if ($book['qty']) {
$this->goto->add($book['book_id'], $book['qty'], (isset($book['opt'])) ? $book['opt'] : NULL);
}
}
我只想将其保存为我的集合,那么,您可能知道另一个 php foreach 示例吗?让我知道。谢谢
I looking for another samples of php foreach code that similar to the code as following:
foreach ($this->ask->post['books'] as $book) {
if ($book['qty']) {
$this->goto->add($book['book_id'], $book['qty'], (isset($book['opt'])) ? $book['opt'] : NULL);
}
}
I just want to save it as my collection, so, is there another samples of php foreach that You may know? let me know it. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许这个例子可以帮助你:
你也可以看看 http://php .net/manual/en/control-structs.foreach.php
Maybe this example can help you:
You can also have a look to http://php.net/manual/en/control-structures.foreach.php
你特别需要foreach吗?
您还可以使用这个:
Do you specifically need foreach?
You can also use this: