title: Warning: Invalid argument supplied for foreach() in line 6
body: <p>I tried to display the source code with line number.
  But i am getting </p>
  
  <blockquote>
    <p>Warning: Invalid argument supplied for foreach()  on line 6</p>
  </blockquote>
  
  <pre><code>$lines= file_get_contents("http://sitename.com");
  
  foreach ($lines as $line_num =&gt; $line) {
      echo "Line #&lt;b&gt;{$line_num}&lt;/b&gt; : " . htmlspecialchars($line) . "&lt;br /&gt;\n";
  }
  </code></pre>