PHP explode string by html tag

前端 未结 2 391
深忆病人
深忆病人 2021-01-21 21:24

Suppose string $a holds

Phasellus blandit enim eget odio euismod eu dictum quam scelerisque.

Sed ut diam nisi.

Ut v

2条回答
  •  广开言路
    2021-01-21 21:49

    ]*>(.*?)<\/p>/is', $a, $matches);
    for ($i = 0; $i < $count; ++$i) {
        $ps[] = $matches[0][$i];
    }
    

    That could be one way. Or you could use a loop with strpos

提交回复
热议问题