开发者

using preg_replace after getting content from preg_match with regexp

开发者 https://www.devze.com 2023-02-17 03:48 出处:网络
I\'m getting problems with my coding. I\'m trying to take out tags from my preg_match_all. I\'m still new and learning.

I'm getting problems with my coding. I'm trying to take out tags from my preg_match_all. I'm still new and learning.

preg_match_all("/\<b>\\$(.*?)\<\/b\>/is", $res[0], $Price );
for($i = 0; $i < count($开发者_Python百科Price); $i++) {
    $Price = preg_replace("/<.*?>/is","",$Price);   

}
foreach($Price[0] as $kgbPrice) 
{
    $PriceArray[] = "<div class='prices' id='kgbdealsPrice'>".$Price."</div>";
}

The array is being outputted somewhere else.

I'm getting content which has

<b>content</b>

Thank you


SIMPLEHTMLDOM has been used by andrewliu for solving his problem. It was a much simpler solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消