php - how can i access a variable defined inside a for each loop outside the loop? -


यहाँ मेरा कोड है ...

  foreach ($ relatedStories- & gt; getResults ) $ की कहानी के रूप में): $ कुल + = $ कहानी- & gt; getEstimation (); endforeach;   

$$ संबंधित स्टोरी मूल्यों की एक सरणी है। अब मुझे बाहर कुल मूल्य का उपयोग करने की आवश्यकता है। मैं ऐसा कैसे कर सकता हूँ ????

बाहर चर $ total परिभाषित करें सूचित करते रहना। ( $ total = 0; )।

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -