Hello and thanks for reading my question. I've got an array from a cookie which is
CookieUpdate. I have another Array which is a smaller field list.
I found using this that only the last field of "$Field"
FOREACH ( $CookieUpdate AS $Key => $Value ) {
FOREACH ( $Field AS $FKey => $FValue ) {
IF ( $Key == $FKey ) {
$CookieArr[$Key] = $FValue;
}ELSE{
$CookieArr[$Key] = $Value;
}
}
reset($Field);
}
For instance if I have these two arrays
$Field = ARRAY(
"Level" => 'Standard',
"LevelExpires" => '2066-06-06 06:06:06',
"NickName" => 'Dev1854',
"Email" => 'dev@test.com'
);
AND
$Cookie = array(
"CRC" => $CookieChips[0],
"TimeMark" => $CookieChips[1],
"ID" => $CookieChips[2],
"Level" => $CookieChips[3],
"LevelExpires" => $CookieChips[4],
"NickName" => $CookieChips[5],
"Email" => $CookieChips[6],
"Password" => $CookieChips[7],
"PrivMessages" => $CookieChips[8],
"TimeZone" => $CookieChips[9],
"LastNavTime" => $CookieChips[10],
"LastNavPage" => $CookieChips[11],
"LastReg" => $CookieChips[12],
"ZipCode" => $CookieChips[13],
"Latitude" => $CookieChips[14],
"Longitude" => $CookieChips[15],
"Thumb" => $CookieChips[16],
"Lang" => $CookieChips[17]
);
The only thing that gets updated is Email which is the last element in Field Array. So I though that maybe the pointer needed to reset but that didn't work....So i'm a little stumped.
Any suggestions?
Thanks 🙂