I have 2 arrays. Sometimes a key/value from array1 may equals to key/value of array2. If that is true, change 'status' from the specific key/value from array2, to a new value. Does that make sense?
Here is where I am at:
foreach($array1 as $i=>$x){
foreach($array2 as $k=>$y){
if($x['url'] == $y['url']){
// Up to here works
foreach($i as &$value) {
$value['status'] = 'new value';
}
break;
}
}
}
This are my arrays:
array(1) {
[0]=> array(1) {
["url"]=> string(104) "aHR0cDovL3lvdXR1YmUuY29t"
["date"]=> string(19) "2014-01-06 21:44:39"
["status"]=> string(1) "0"
}
[1]=> array(1) {
["url"]=> string(28) "d3d3LnR3aXR0ZXIuY29t"
["date"]=> string(19) "2014-01-06 14:28:32"
["status"]=> string(1) "0"
}
}
and array2:
array(2) {
[0]=> array(2) {
["url"]=> string(104) "aHR0cDovL3lvdXR1YmUuY29t"
["date"]=> string(19) "2014-01-06 21:44:39"
}
[1]=> array(2) {
["url"]=> string(28) "aHR0cDovL3d3dy5nb29nbGUuY29t"
["date"]=> string(19) "2014-01-06 14:28:32"
}
}
Up to the comment it works. From there after, how can I change that specific key/value to a new value? My current example changes all key 'status' to 'new value'.