title: Detect EOL type using PHP
body: <blockquote>
    <p><strong>Reference:</strong> This is a self-answered question. It was meant to share the knowledge, Q&amp;A style.</p>
  </blockquote>
  
  <p>How do I detect the type of <a href="http://en.wikipedia.org/wiki/Newline" rel="noreferrer">end of line</a> character in PHP?</p>
  
  <p><em>PS: I've been writing this code from scratch for too long now, so I decided to share it on SO, plus, I'm sure someone will find ways for improvement.</em></p>