Before anyone says 'try Google', I've already done that plus searched php.net for a solution :)
So here is my issue. I have a rather complex multi-dimensional array which is being produced by a method in a class that carries out a levenshtein based matching algorithm upon passed data to a table of existing data. Here is an example of how the array would look:
[6976989] => Array
(
[recid] => 4
[appid] =>
[loanid] => 6976989
[import_name] => Joe Bloggs
[import_postcode] => BL0 G55
[import_email] => blahh@blahhh.co.uk
)
[32424] => Array
(
[recid] => 5
[appid] => 345
[loanid] => 32424
[import_name] => Henry Hill
[import_postcode] => BS5 1GH
[import_email] => thisis@myemail.com
[matches] => Array
(
[5] => Array
(
[appid] => 345
[match_name] => Henry Hall
[match_postcode] => BS5 1GH
[match_email] => thisis@myemail.com
)
)
)
The array will basically find close matches from the data passed in from a third party company and then use this result on a CRM interface for the client to approve or reject the matches presented.
That's how it works - and it works well. However, the issue is that some of the data passed to the table is completely different to any data existing (in the case of Joe Bloggs above) and so there is no match array to offer the user. The way we can tell this is that the [appid] is blank (this is the id which matches the first returned match). If the appid is blank or NULL then I need this to appear at the bottom of the interface. I've tried doing a usort() on the appid value but I'm not very experienced with array sorting in this way and whatever I do and whatever suggestions offered by php.net I use I cannot get the result I need.
Sorry if all this is a long-winded explanation but I thought it best to be specific. So if anyone has any ideas on how to do this, I would be very grateful.
Thank you in advance,
Michael