- print_r: documentation ( source)
- preg_split: documentation ( source)
<?php
$s = "---\n
title = A nice title goes here\n
tags = tag1 tag2 tag3\n
---\n
This is the content of this entry...\n
Line2\n
Line3\n";
$p1 = preg_split("/[\n]*[-]{3}[\n]/", $s, 3, PREG_SPLIT_NO_EMPTY);
$p2 = preg_split("/[\n]*[-]{3}[\n]/", $s, 2, PREG_SPLIT_NO_EMPTY);
print_r($p1);
print_r($p2);