I'm trying to create a multidimensional array of values to update a Filemaker db. Edits to existing fields end in numbers (the record ID).I'm having a problem, probably obvious to anyone here in setting up the multidimensional array:

$updateEntries = array(); //stores existing db entries
$ord = -1;
$recNum = 0;
foreach ($_POST as $key => $value) {
if ($value != "") {
$lastPartPos = strrchr($key, '_');
$lastPart = substr($lastPartPos, 1);
if (preg_match("/[0-9]+/" , $lastPart)) { //if it's an existing update
$lastpartnum = strrpos($key, '_');
$firstnum = substr($key, 0, $lastpartnum);
$first = str_replace('_', '.', $firstnum); //restore periods to field name and strip off record ID at end
if ($lastPart != $recNum) {
$recNum = $lastPart;
$ord++;
$updateEntries[$ord] = $recNum;
}
$updateEntries[$ord][] = array($first, $value); //populate nested arrays of each entry
etc......


throws:
"PHP Fatal error:  [] operator not supported for strings"

How do I make $updateEntries[$ord] evaluate as an array?

Thanks in advance

RG



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to