- var_dump: documentation ( source)
- preg_last_error: documentation ( source)
- print_r: documentation ( source)
- ini_set: documentation ( source)
- preg_split: documentation ( source)
- ini_get: documentation ( source)
<?php
$text = '<p>www.test.com</p>';
echo 'pcre.backtrack_limit: ' . ini_get('pcre.backtrack_limit') . PHP_EOL;
$chunks = preg_split('/(<.+?>)/is', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
echo 'error: ' . preg_last_error() . PHP_EOL;
is_array($chunks) ? print_r($chunks) : var_dump($chunks);
ini_set('pcre.backtrack_limit', 1);
echo 'pcre.backtrack_limit: ' . ini_get('pcre.backtrack_limit') . PHP_EOL;
$chunks = preg_split('/(<.+?>)/is', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
echo 'error: ' . preg_last_error() . PHP_EOL;
is_array($chunks) ? print_r($chunks) : var_dump($chunks);