Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Wondering why my variable doesn't increment inside of a function

Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm new to PHP and to functions, so I'm a bit confused as to why my variable isn't incrementing inside of a function.

Here's what I basically have:

But the echo $atriskbanks prints a 0, which is what I initialized the variable to earlier. So it's definitely not incrementing. ($ratio>75 is true in this case. $ratio is 100 point something).

Does anyone know why this variable isn't incrementing when I call the function?

Thank you very much for any thoughts you may have about this.
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Brenda, this page should explain what the problem is and how to fix it:
Let nothing stop you! Not even this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic