0

I have the string $content with an big and aleatory text. I want to explode $content and the delimiter was the first occourcence of any value in the array $array_explode. Could anyone help me?

Something like that:

$content="...";
$array_explode = array("<br>", "<p>", "<h2>", "<h1>", "<h3>");
$content_explode = explode($array_explode, $content);

1 Answers1

-1
<?php

$content = "...";
$content = str_replace(array("<br>", "<p>", "<h2>", "<h1>", "<h3>"), array("<br>".chr(30), "<p>".chr(30), "<h2>".chr(30), "<h1>".chr(30), "<h3>".chr(30)), $content);
$content_explode = explode(chr(30), $content);

?>