- explode: documentation ( source)
<?php
$fileContent = <<<'PHP'
before
-----
after
PHP;
echo $fileContent;
echo PHP_EOL . PHP_EOL . PHP_EOL . PHP_EOL;
[$before, $after] = explode("\n-----\n", $fileContent);
echo $before;
echo PHP_EOL . PHP_EOL;
echo $after;
echo PHP_EOL . PHP_EOL;