Hi,
Is it possible to "index into" the $data['fieldname'] array? I have tried: $data['fieldname[X]'] but it didn't work..
a little example of what I want:
fieldnames = array("fieldname1","fieldname2","fieldname3");
for ($x = 0; $x <= 10; $x++) {
$data( [fieldname[x] ) = something;
}
I have fields both before and after the fields I want to alter, so I would preffer not to loop through all the fields in the table...
I hope you understand my explanation, any help is appriciated, thank you
Kind regards
Peter
Use variable in $data
Re: Use variable in $data
Code: Select all
$fieldnames = ["fieldname1", "fieldname2"];
foreach ($fieldnames as $fieldname) {
// your code
// for example
// $data[$fieldname] = strtoupper($data[$fieldname]);
}
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: Use variable in $data
Cool, as simple as that! Thank you