I need help with this problem:
look at this code:
Code: Select all
$s = '<p>bleh blah</p><p style="one">one two three</p>';
$htmlbits = preg_split('/(<p( style="[-:a-z0-9 ]+")?>|<\/p>)/i', $s, -1, PREG_SPLIT_DELIM_CAPTURE);
print_r($htmlbits);
Code: Select all
Array
(
[0] =>
[1] => <p>
[2] => bleh blah
[3] => </p>
[4] =>
[5] => <p style="one">
[6] => style="one"
[7] => one two three
[8] => </p>
[9] =>
)
I can easily use this:
Code: Select all
$htmlbits = preg_split('/(<p(?: style="[-:a-z0-9 ]+")?>|<\/p>)/i', $s, -1, PREG_SPLIT_DELIM_CAPTURE);
for example:
Code: Select all
$htmlbits = preg_split('/(<p(?=<f> style="[-:a-z0-9 ]+")?>|<\/p>)/i', $s, -1, PREG_SPLIT_DELIM_CAPTURE);
so what can I do to hide index 6 of array