PHP: How to decrement a string function by 1?
<p>I'm using PHP to access an external API.</p>

<p>When a call a particular API method, it returns a number one higher than I want to display.</p>

<p>However, the API is returning the integer as a string and not an integer.</p>

<p><strong>Question:</strong> How can I decrement the returned string by 1 since it's not an integer</p>

<p>Essentially, I want to do the follow pseudo-code (that doesn't work):</p>

<pre><code>echo external_api() -1; // problem is, this returns "X -1" where "X" is an integer but returned as a strong
</code></pre>
