Hi please see commented line, that foreach loop only display 2 columns from 9 columns, they are key and value. $suggestions=array('value'=> $key, 'label' => $value) // Please take a look at this line $temp_suggestions = $row->name.' Unit Price: '.$row->unit_price įoreach($temp_suggestions as $key => $value) The following foreach loop is used for reading the. The iterable expression could be an array, or an Iterable.$temp_suggestions = $row->name. The foreach loop can be used to read the array values only or read both keys and values of the array. PHP foreach looping statement executes a block of statements once for each of the element in the iterable (or iterable expression). In this PHP tutorial, you shall learn about foreach statement, its syntax, and how to use foreach statement to iterate over elements of a collection, example programs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |