15 lines
317 B
PHP
15 lines
317 B
PHP
<?php
|
|
function scanOG($url) {
|
|
$og = array();
|
|
$html = file_get_contents($url);
|
|
|
|
$re = '/<meta (name|property)=("|\')(.*?)("|\').*?content=("|\')(.*?)("|\')/m';
|
|
preg_match_all($re, $html, $matches, PREG_SET_ORDER, 0);
|
|
|
|
foreach($matches as $m) {
|
|
$og[$m[3]] = $m[6];
|
|
}
|
|
//print_r($og);
|
|
return $og;
|
|
}
|
|
?>
|