![](/img/trans.png)
[英]How do I loop a nested array in laravel to get an array based on conditions of key values from that array
[英]Laravel, how do I get the array values using their index?
$my_array = [0,1,2,3,4,5,6,7,8,9,];
您需要數組編號5,因此請執行以下操作:
$data = array_keys($my_array, 5);
您可以使用 :
foreach( $array as $index => $element )
{ 'show'. $index . '=>'. $element }
試試這個:假設您有$ data作為數組,並且要打印第3個元素,那么$ data [3]將給您第3個元素。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.