douxi3432
douxi3432
2014-04-09 16:32

简单的HTML dom css选择器无法正常工作

  • css
  • dom
  • php

in reference to http://simplehtmldom.sourceforge.net/

I have this code:

require_once('simple_html_dom.php');

$x = '<span style="font-family:symbol">&#174;</span>';
$dom = str_get_html($x);
$lis = $dom->find('[style=~font-family:symbol]');
print_r($lis);

Which tries to find tags whose style has the font-family:symbol in it using a css selector.

However this returns nothing.

What is wrong with my code?

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答