स्ट्रिंग / इंट कीज़ को रखते हुए मैं दो सरणियों (स्ट्रिंग के साथ एक) = वैल्यू पेयर और दूसरा इंट (> वैल्यू पेयर) के साथ कैसे विलय कर सकता हूं? उनमें से कोई भी कभी भी ओवरलैप नहीं होगा (क्योंकि एक में केवल तार होते हैं और दूसरे में केवल पूर्णांक होते हैं)।
यहाँ मेरा वर्तमान कोड है (जो काम नहीं करता है, क्योंकि array_merge पूर्णांक कुंजियों के साथ सरणी को फिर से अनुक्रमित कर रहा है):
// get all id vars by combining the static and dynamic
$staticIdentifications = array(
Users::userID => "USERID",
Users::username => "USERNAME"
);
// get the dynamic vars, formatted: varID => varName
$companyVarIdentifications = CompanyVars::getIdentificationVarsFriendly($_SESSION['companyID']);
// merge the static and dynamic vars (*** BUT KEEP THE INT INDICES ***)
$idVars = array_merge($staticIdentifications, $companyVarIdentifications);
array( 123 => "VALUE123" )
हैarray( 0 => "VALUE123" )