在网站允许我访问他的 API 之前,我只需要显示该网站上的两件事:
这两件事包含在 div 中:
<div style="float: right; margin: 10px;">
here what i want to display on my website
</div>
问题是我在stackoverflow上找到了一个例子,但我以前从未写过preg_match。如何处理我想要抓取的数据?谢谢
<?php $html = file_get_contents($st_player_cv->getUrlEsl());
preg_match_all(
'What do i need to write here ?',
$html,
$posts, // will contain the data
PREG_SET_ORDER // formats data into an array of posts
);
foreach ($posts as $post) {
$premium = $post[1];
$level = $post[2];
// do something with data
}