Store a large array in a php file -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 2 जवाब

मेरे पास एक बड़ा "कॉन्फ़िगरेशन "सरणी जो मैं एक अलग फ़ाइल में स्टोर करना चाहता हूं (इस प्रथा को लार्लेज की कॉन्फ़िग फाइल से लेना)।

इसे app / config / myconfig.php

में संग्रहीत करने के बाद
  & lt;? Php रिटर्न सरणी ('foo' = & gt; 'बार',);  

अगर मैं इसे असाइन करना चाहता हूं तो मैं इसे अपने कोड में कैसे बुलाऊँगा? जैसे $ myarray = app / config / myconfig.php

<पी> फ़ाइल शामिल करें:

  $ myarray = include 'app / config / myconfig.php';  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -