Check if Variable is smaller than others, and which one its smaller than. PHP
<p>I have been working on my scoring system and came accros this.
I have 4 vars.</p>

<pre><code>$newscore
$score1
$score2
$score3
</code></pre>

<p>I want to see if new score is lower than the 3 others, and if so which ones. The scoring system requires you to have the lowest possible score.</p>

<p>I have the following code:</p>

<pre><code>if($newscore &gt; $score1){

               if($newscore &gt; $score2){

                    if($newscore &lt; $score3){

                        //has to be score3 to replace.

                    }

                }else{

                    ...

                }

            }
</code></pre>

<p>But what I'm wondering is if I will have to continue on with all these if statements, or is there something a lot shorter and easier? I need to replace the the score that it is smaller than, but not the one its larger than. Score 1 2 and 3 are all the players stats. And if I do have to continue on with all the if statements, how would the code look (its baffling my logic)?</p>