How to know the source file is write in newline or a line in PHP?
<p>How to know  the source file is write in newline or a line?</p>

<p>I have a file that contains the text:</p>

<p>example:</p>

<p><strong>file1(can be just only one line) :</strong></p>

<p><code>hello stackoverflow hello stackoverflow hello stackoverflow hello 
stackoverflow hello stackoverflow</code></p>

<p><strong>file2(can be multiple line)</strong></p>

<pre><code>  hello stackoverflow
  hello stackoverflow
  hello stackoverflow
  hello stackoverflow
</code></pre>

<p>How Can we know that in this file Are there the newline or online with PHP;</p>

<p>UPDATE:</p>

<pre><code>&lt;?
$content1 = "lin1 
           lin2";

$content2 = "lin1 lin2";

function file_source_is_new_line($content){
    $data = str_replace(array(chr(13).chr(10),chr(10)),chr(13),$content);
    $matches = count(explode(chr(13),$data));
    echo  count($matches); 
}
file_source_is_new_line($content1);
?&gt;
</code></pre>

<p>Always give <code>1</code> ?</p>
