I have this function; I'm trying to fill the $records array with multiple entries of each $vendor. Only the first record goes in the $records array 12 times like I want it to. Now I would like to get the rest to do the same.
function vendors()
{
$vendor = [
"Chick-Fil-A #03971 Houston TX" => 3,
"Uber Trip Help.Uber.Com TX" => 8,
"Starbucks Store 05 Houston TX" => 3,
"Shell Service S Houston TX" => 3,
"Ralphs #0 1200 N Centr Houston TX" => 3,
"Nails Van Nuys TX" => 3,
"Postmates Ed3F9 to Httpspostmate CA" => 3,
"Pico Beauty Supply and SA Houston TX" => 3,
"Big Mamas & Papas 818-679-9976 TX" => 3,
"CIT-GO Houston TX" => 3,
"Dollar Tree Houston TX" => 3,
"McDonald's M6310 O Houston TX" => 5,
"Jamba Juice - Houston TX" => 3,
"Cvs/Pharm 10445--125 N Glendale" => 3,
];
$records = array();
foreach ($vendor as $key => $value)
{
$times = $value * 4;
$records = array_fill(0, $times, $key);
}
return $records;
}
$recordsarray on each loop?