I
I
iurakuleshov2020-05-14 18:58:38
PHP
iurakuleshov, 2020-05-14 18:58:38

How to make such a function with arrays?

Good afternoon, I have such a question, there are two arrays in which the number of keys is the same (but the total number may change, but they will always be equal to each other)

array(3) { 
   [0]=> string(2) "59"
   [1]=> string(2) "60" 
   [2]=> string(2) "19" 
} array(3) { 
   [0]=> string(1) "3"
   [1]=> string(1) "2"
   [2]=> string(1) "1" 
}

I need to make sure that the first key in the first array is multiplied by the first key in the second array, and so on. with each key (I repeat once again that the number may vary).
Can you please tell me how to implement this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2020-05-14
@iurakuleshov

https://www.php.net/manual/en/function.array-map.php
https://ideone.com/81xf3V

T
ThunderCat, 2020-05-14
@ThunderCat

форич (аррэй аз кей=> валуе){
   ...
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question