Page MenuHomePhorge

function phutil_split_lines($corpus, $retain_endings)
libphutil Technical Documentation (Core Utilities)

Split a corpus of text into lines. This function splits on "\n", "\r\n", or a mixture of any of them.

NOTE: This function does not treat "\r" on its own as a newline because none of SVN, Git or Mercurial do on any OS.
Parameters
string$corpusBlock of text to be split into lines.
bool$retain_endingsIf true, retain line endings in result strings.
Return
listList of lines.