PHP: How to decrement a string function by 1?

shinji

New Member
I'm using PHP to access an external API.When a call a particular API method, it returns a number one higher than I want to display.However, the API is returning the integer as a string and not an integer.Question: How can I decrement the returned string by 1 since it's not an integerEssentially, I want to do the follow pseudo-code (that doesn't work):\[code\]echo external_api() -1; // problem is, this returns "X -1" where "X" is an integer but returned as a strong\[/code\]
 
Back
Top