note 127667 added to function.array-column
| From: | AliKareshkifromIRAN at main dot php dot net | Date: | Mon, 26 Sep 2022 09:35:34 +0000 |
| Subject: | note 127667 added to function.array-column | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219615@lists.php.net to get a copy of this message | ||
You can get a result like array_column() . check this example to find out how it works :
//this is my main array : $family
//it have nested arrays that they are arrays with no name(just bruckets)
$family = [
[
'name' => 'Ali',
'age' => 21
],
[
'name' => 'Reyhaneh',
'age' => 12
],
[
'name' => 'Maryam',
'age' => 47
],
[
'name' => 'Mahdi',
'age' => 47
]
];
foreach ($family as $Ffmember){
foreach ($Ffmember as $key => $value){
switch ($key){
case 'name':
var_dump($Ffmember['name']);
echo "<br>";
break;
default:
break;
}
}
}
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.173 (proxied: 5.126.122.254)
----
Manual Page -- https://php.net/manual/en/function.array-column.php
Edit -- https://main.php.net/note/edit/127667
Del: integrated -- https://main.php.net/note/delete/127667/integrated
Del: useless -- https://main.php.net/note/delete/127667/useless
Del: bad code -- https://main.php.net/note/delete/127667/bad+code
Del: spam -- https://main.php.net/note/delete/127667/spam
Del: non-english -- https://main.php.net/note/delete/127667/non-english
Del: in docs -- https://main.php.net/note/delete/127667/in+docs
Del: other reasons-- https://main.php.net/note/delete/127667
Reject -- https://main.php.net/note/reject/127667
Search -- https://main.php.net/manage/user-notes.php