$foreignKey) { $keyCount = 0; foreach ($foreignKey as $oneKey) { $lineParts = explode('`', $oneKey); $keyList[$keyCount][FK_FIELD] = $lineParts[FK_FIELD]; $keyList[$keyCount][FK_REF_TABLE] = $lineParts[FK_REF_TABLE]; $keyList[$keyCount][FK_REF_FIELD] = $lineParts[FK_REF_FIELD]; $keyCount++; } } return $keyList; } /******** * This is the end of the code that actually helps to find foreign keys for any MySQL table. * All further code past this point is used to demonstrate how to use Phind to actually find foreign keys * in a table. ****************/ ?>

Example usage for finding foreign keys in a table with Phind