Array strangeness
| From: | Lester Caine | Date: | Mon, 04 Jan 2016 15:02:28 +0000 |
| Subject: | Array strangeness | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-325323@lists.php.net to get a copy of this message | ||
Code is simple enough in long hand ...
$surname = array();
$name = $row['n_surn'];
$cnt = $row['sn_count'];
print_r($row);
print($name);
print($cnt);
$surnames[$name]['name'] = $name;
$surnames[$name]['match'] = $cnt;
Result ...
Array ( [n_surn] => CORTEEN [sn_count] => 227 )
CORTEEN
227
Array ( [CORTEEN] =>
Array ( [name] => CORTEEN
[match] => Array ( [name] => CORTEEN [match] => 227 ) ) )
WHY is the [match] an array rather than the 227 value from the original
result array.
Actual code was not expanded using the intermediate variables, but the
problem is that incorrect value in the match field :(
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk