title: Show different image based on time
body: <p>I'm trying to make a code that will show two different images depending on what the time is and what day it is.</p>
  
  <p>I want it to show an image that says "open" between 7:25 - 12:40 and 13:30 - 14:10 when it's between the days monday to friday. On weekends and at any other time it should show the image "closed".</p>
  
  <p>Here's the code I've been trying to get to work.</p>
  
  <pre><code>    &lt;?php
  date_default_timezone_set('Europe/Copenhagen');
  
  $h = date('Gi'); //G (timer) = 0 til 23 og i (minutter) = 00 til 59
  
  $d = date('N'); //1 (for mandag) til 7 (for søndag)
  
  
  // MANDAG
  if ($d = '1' &amp;&amp; $h &gt;= 745 &amp;&amp; $h &lt; 1240) $img = 'images/open.png';
  if ($d = '1' &amp;&amp; $h &gt;= 1330 &amp;&amp; $h &lt; 1410) $img = 'images/open_red.png';
  
  // TIRSDAG
  if ($d = '2' &amp;&amp; $h &gt;= 745 &amp;&amp; $h &lt; 1240) $img = 'images/open.png';
  if ($d = '2' &amp;&amp; $h &gt;= 1330 &amp;&amp; $h &lt; 1410) $img = 'images/open_red.png';
  
  // ONSDAG
  if ($d = '3' &amp;&amp; $h &gt;= 745 &amp;&amp; $h &lt; 1240) $img = 'images/open.png';
  if ($d = '3' &amp;&amp; $h &gt;= 1330 &amp;&amp; $h &lt; 1410) $img = 'images/open_red.png';
  
  // TORSDAG
  if ($d = 4 &amp;&amp; $h &gt;= 745 &amp;&amp; $h &lt; 1240) $img = 'images/open.png';
  if ($d = 4 &amp;&amp; $h &gt;= 1330 &amp;&amp; $h &lt; 1410) $img = 'images/open_red.png';
  
  // FREDAG
  if ($d = 5 &amp;&amp; $h &gt;= 745 &amp;&amp; $h &lt; 1240) $img = 'images/open.png';
  
  // LØRDAG
  
  
  // SØNDAG
  
  
  else $img = 'images/closed.png';
  ?&gt;
  
  &lt;img src="&lt;?php echo $img; ?&gt;"&gt;
  </code></pre>
  
  <p>For some reason it ignores the day variable and simply print out the last entry, that being "fredag" (friday).</p>