how to get first session to equal 1?
<p>Below I have a line of code where it states which Session a user is currently on out of the number of Total Sessions. </p>

<pre><code>&lt;h1&gt;CREATING QUESTIONS AND ANSWERS: SESSION (AAA) &lt;?php echo $sessionMinus ?&gt; OF &lt;?php echo $_SESSION['initial_count'] ?&gt;&lt;/h1&gt;
</code></pre>

<p>So for example the line could read this:</p>

<pre><code>CREATING QUESTIONS AND ANSWERS: SESSION (AAA) 3 OF 3
</code></pre>

<p>Now the problem I have is that lets say I want 3 Sessions, It should read like this:</p>

<p>First time user opens page: <code>CREATING QUESTIONS AND ANSWERS: SESSION (AAA) 1 OF 3</code></p>

<p>But instead it is reading like this: <code>CREATING QUESTIONS AND ANSWERS: SESSION (AAA) 3 OF 3</code></p>

<p>Same if lets say I want 7 Sessions, for first session it should be: <code>CREATING QUESTIONS AND ANSWERS: SESSION (AAA) 1 OF 7</code> but instead it is reading like this: <code>CREATING QUESTIONS AND ANSWERS: SESSION (AAA) 7 OF 7.</code></p>

<p>So my question is that how can I get the first session to equal 1 out of ... </p>

<p>Below is the current code:</p>

<pre><code>if(isset($_POST['sessionNum'])){
            //Declare my counter for the first time

            $_SESSION['initial_count'] = $_POST['sessionNum'];
            $_SESSION['sessionNum'] = $_POST['sessionNum'];

    }

if (!isset($_SESSION['sessionCount'])) {
    $_SESSION['sessionCount'] = 1;
}
else if ($_SESSION['sessionCount'] &lt; $_SESSION['sessionNum']) {
    ++$_SESSION['sessionCount'];
}


$sessionMinus =  $_SESSION['sessionCount'];
</code></pre>

<p>UPDATE:</p>

<p>Below was a previous attempt which did not work as it keep stating 2 OF 4 or 2 OF 5 or 2 OF 2 and etc:</p>

<pre><code>if(isset($_POST['sessionNum'])){
            //Declare my counter for the first time

            $_SESSION['initial_count'] = $_POST['sessionNum'];
            $_SESSION['sessionNum'] = $_POST['sessionNum'];
            $_SESSION['sessionCount'] = 0;

    }

else if ($_SESSION['sessionCount'] &lt; $_SESSION['sessionNum']) {
    $_SESSION['sessionCount']++;
}


$sessionMinus =  $_SESSION['sessionCount'];
</code></pre>
