openmgraph und hotfix in string

This commit is contained in:
troy
2022-03-20 12:07:25 +01:00
parent e44c10c5c2
commit 88f87e15b4
2 changed files with 20 additions and 5 deletions

15
og.php Normal file
View File

@@ -0,0 +1,15 @@
<?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;
}
?>