Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从 php 中的另一个文件中获取特定的元标记?这是我用来创建元标记的代码:<meta name="thumbnail" content="1.png" />
<meta name="thumbnail" content="1.png" />
这是我在javascript中尝试过的:
var x = document.getElementByID('myIdExample').content; alert(x);
但是因为元标记在外部页面中,所以我不起作用。
explode() 如果通过使用替换为**thumbnail**您想要使用的标签的名称来修复...
explode()
**thumbnail**
$thumbnail = get_meta_tags('http://s0ulp1xel.x10.mx/background-garage/?p=photo&photo=1'); $thumbnail = array_map('trim', explode(',', $thumbnail['**thumbnail**']));