title: change value of variable based on conditions php
body: <p>I have a class name that should change based on certain conditions but either my syntax or my logic seems to be incorrect as it doesn't work:</p>
  
  <pre><code>if ( $hometeam &amp;&amp; ($homescore &gt; $awayscore) || $awayteam &amp;&amp; ($awayscore &gt; $homescore)){
                          $status= 'win'; 
                      }                       
  if ( $hometeam &amp;&amp; ($homescore &lt; $awayscore) || $awayteam &amp;&amp; ($awayscore &lt; $homescore)) {
                          $status= 'lose';
                      }                       
  if ($homescore == $awayscore) {
                          $status= 'draw';
                      }
  </code></pre>
  
  <p>My elements each have a <code>class="&lt;?php echo $status; ?&gt;"</code> and I want them to be styled differently depending on the value of <code>$status</code>. I didn't use <code>else if</code> because I didn't want it to apply the value and stop but it looks like that is what is happening. </p>
  
  <p>Edit: Some clarification:</p>
  
  <pre><code>&lt;ul class="match group"&gt;    
                  &lt;li&gt;
                      &lt;ul class="team1 &lt;?php echo $status; ?&gt;"&gt;
                          &lt;li class="teamname"&gt;&lt;h2&gt;&lt;?php echo $homename; ?&gt;&lt;/h2&gt;&lt;/li&gt;  
                          &lt;li class="teamscore"&gt;&lt;?php echo $homescore; ?&gt;&lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/li&gt;
                  &lt;li&gt;
                      &lt;ul class="team2 &lt;?php echo $status; ?&gt;"&gt;
                          &lt;li class="teamname"&gt;&lt;h2&gt;&lt;?php echo $awayname?&gt;&lt;/h2&gt;&lt;/li&gt;    
                          &lt;li class="teamscore"&gt;&lt;?php echo $awayscore?&gt;&lt;/li&gt;                              
                      &lt;/ul&gt;
                  &lt;/li&gt;
                  &lt;li&gt;&lt;ul class="matchinfo"&gt;
                          &lt;li&gt;&lt;a href="reports.html#report4"&gt;&lt;button&gt;Get Report&lt;/button&gt;&lt;/a&gt;&lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>