मैं इस $ sort_flags सरणी को compar_by_flags फ़ंक्शन के भीतर उपलब्ध करना चाहता हूं, लेकिन मुझे इसका कोई तरीका नहीं मिला, क्या यह संभव है?usort/uasort cmp फ़ंक्शन में अतिरिक्त पैरामीटर कैसे जोड़ें?
public function sort_by_rank(array $sort_flags = array()) {
uasort($this->search_result_array, array($this, 'compare_by_flags'));
}
private static function compare_by_flags($a, $b) {
// I want to have this $sort_flags array here to compare according to those flags
}
आप किस PHP संस्करण का उपयोग करते हैं? – zerkms
5.2, लेकिन जल्द ही – Riesling