- Edited
Hi there. I haven't done much programming with PHP since 5.6. I notice a web app I designed no longer works because i had the following code:
if($anPregResult){
foreach($alnumParam as $anFuncKey => $anFuncVal){
if($firstChar === $anFuncKey) {
$alnumParam[$anFuncKey][] = $thisDirObject;
break 1;
}
}
}
How do we handle that $array[$key][] = whatever sort of assignment now? Xdebug tells me it's invalid in PHP 7.4
I tried to fix it like this, but it seems unnecessarily clunky, and... it doesn't work as the prev code did
if ($anStrposResult !== false) {
$addAlphaNumCounter = 0;
foreach ($alnumParam as $anFuncKey => $anFuncVal) {
if(ucfirst($firstChar) === ucfirst($anFuncKey)) {
/* $alnumParam[ucfirst($anFuncKey)][] = $thisDirObject;
break 1; */
$alnumParam[ucfirst($anFuncKey)][$addAlphaNumCounter] = $thisDirObject;
$addAlphaNumCounter++;
break 1;
}
}
}
Thanks for reading!
BTW
I had an account here, many years ago, but the userid / pass doesn't work anymore. i realize the forum has been upgraded since then.
i don't know if the old stuff still exists or not, but I must admit I'm curious what I posted here in the past. I recall it being my preferred PHP resource for help.