shotufuk wrote:Why str is 0?
It's 0 because you can't subtract a string from another string - subtraction is only performed on numbers (can you tell me the answer to: "Banana" - "Spork" + "Freebird" ?). Since PHP is a (very) loosely-typed language, it assumes that you meant to convert those strings to numbers and attempts to do so (silently) for you. It does this by reading up to the first character that doesn't make sense.
In other words, it's subtracting 2011 from 2011 and getting 0.
shotufuk wrote:How can i find the difference between numbers??
Easy - by using subtraction.
However, you've got to have numbers first.