function drop_key_php($structure, $table, $key) {

        $result = '';
        // Validate if we can do it
        if (!$table = $structure->getTable($table)) {
            return false;
        }
        if (!$key = $table->getKey($key)) {
            return false;
        }
        if ($table->getAllErrors()) {
            return false;
        }

        // Add the standard PHP header
        $result .= XMLDB_PHP_HEADER;

        // Add contents
        $result .= XMLDB_LINEFEED;
        $result .= '        // Define key ' . $key->getName() . ' ('. $key->getXMLDBKeyName($key->getType()) . ') to be dropped form ' . $table->getName() . '.' . XMLDB_LINEFEED;
        $result .= '        $table = new xmldb_table(' . "'" . $table->getName() . "'" . ');' . XMLDB_LINEFEED;
        $result .= '        $key = new xmldb_key(' . "'" . $key->getName() . "', " . $key->getPHP(true) . ');' . XMLDB_LINEFEED;

        // Launch the proper DDL
        $result .= XMLDB_LINEFEED;
        $result .= '        // Launch drop key ' . $key->getName() . '.' . XMLDB_LINEFEED;
        $result .= '        $dbman->drop_key($table, $key);' . XMLDB_LINEFEED;

        // Add the proper upgrade_xxxx_savepoint call
        $result .= $this->upgrade_savepoint_php ($structure);

        // Add standard PHP footer
        $result .= XMLDB_PHP_FOOTER;

        return $result;
    }