how replace one array to second array? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

how replace one array to second array?

ex a{1,2,3,4} replace{1,0,1,0}

23rd Aug 2016, 4:49 AM
Durgesh
Durgesh - avatar
4 Answers
+ 3
$a = $replace;
23rd Aug 2016, 7:46 PM
Dark Heart
Dark Heart - avatar
0
please explain shortly francis ...any example
23rd Aug 2016, 11:31 AM
Durgesh
Durgesh - avatar
- 1
for ($i=0; $i<length($a); $i++) {$a[$i] = $replace[$i];} check 'for', maybe I write it wrong
23rd Aug 2016, 6:37 AM
Snorrky
Snorrky - avatar
- 1
your for is good except is count($a) if $a is an array
23rd Aug 2016, 11:20 AM
francis