Home>
id = 1, product = Chair
id = 2, product = pencil
$filearr = file ('send.txt');
foreach ($filearr as $no) {
echo $no;
}
In the above code, you can get anything other than id. How can I get only the id part?
-
Answer # 1
-
Answer # 2
File is used, so it is not in the associative array in the first place.
It needs to be extracted in some way.
Since the specification is unknown, it's messy, but it looks like the following.
Related articles
- i want to edit a specific value value in a php associative array
- i want to bring an associative array to the next screen in php
- [php] method to overwrite associative array data with the contents of form
- php - i want to add selected in laravel associative array
- reorganization of php associative array
- i want to know how to extract words from a sentence and make them into an array in php
- php - about laravel's associative array
- i want to remove values that are not in the array in php from the associative array
- i want to display an associative array as a table in php
- php - extract the ○ th element from the end of the two-dimensional array
- creating an associative array using php and variable names as keys
- php - array i want to put the images in the array in and display them in order
- read a text file as an array with php, break each line and display it on the browser (loop processing)
- in python, i want to extract an array from a number reference
- javascript - i want to display the contents of an associative array and a combination of arrays
- php - unable to expand when passing an array to view with request
- how to specify an associative array for the typescript interface
- rewrite nested associative array values in javascript
- typescript associative array call results in error
- dart - how to add and retrieve keys and values to an associative array with flutter
Trends