-2
I own the following arrays:
$lista_geral= array(
0|7897748704559 =>'',
0|7897748704009 =>'',
0|7897748705501 =>'',
0|7897748704160 =>'',
0|7897748704573 =>'',
0|7897748704238 =>'',
0|7897748705587 =>'',
0|7897748705556 =>'',
0|7897748704337 =>'',
0|7897748704320 =>'',
);
$lista_quantidade = array(150,10,6,12,45,50,5,25,3,2);
I want to take the values of array($lista_geral
) and put in order on array($lista_quantidade
)
thus:
Array
(
[0|7897748704559] => 150
[0|7897748704009] => 10
[0|7897748705501] => 6
[0|7897748704160] => 12
[0|7897748704573] => 45
[0|7897748704238] => 50
[0|7897748705587] => 5
[0|7897748705556] => 25
[0|7897748704337] => 3
[0|7897748704320] => 2
)
I’ve tried using the array_push
but it didn’t work, I would like some help please.
My code:
foreach($lista_quantidade as $ListaQuantidade){
array_push($lista_geral, $ListaQuantidade);
}
The
0|
of0|7897748704160
must disappear?– Woss
he is irrelevant can remain
– VINICIUS SOUZA DE ARAUJO
if you have access to the indexes and know that they always start with
0|alguma_coisa
, you can change the content to remove the0|
.– rLinhares