[ create a new paste ] login | about

Link: http://codepad.org/ubFnMeKN    [ raw code | output | fork ]

PHP, pasted on Oct 18:
1
2
3
4
5
6
7
<?php

$str = "<p>Michael is 26</p><p>He likes green cars.</p><p>And white footballs</p><p>And red lollies</p><p>And yellow suns</p>";

list($str1, $str2) = preg_split('~(?<=</p>)~', $str, 2);

var_dump($str1, $str2);


Output:
1
2
string(20) "<p>Michael is 26</p>"
string(97) "<p>He likes green cars.</p><p>And white footballs</p><p>And red lollies</p><p>And yellow suns</p>"


Create a new paste based on this one


Comments: