Answer the question
In order to leave comments, you need to log in
How to fill an array with a property of another?
Task. Fill array $b with numbers 1, 2, 3, 4 only.
$a = [
[1, 1000],
[2, 1500],
[3, 2000],
[4, 2500],
];
$b = [];
foreach($a as $v){
$b[] = $v[0];
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question