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;
}
?>

View File

@ -39,7 +39,7 @@ function random($name_laenge) {
@mt_srand ( ( double ) microtime () * 1000000 );
for($i = 0; $i < $name_laenge; $i ++) {
$r = mt_rand ( 0, strlen ( $zeichen ) - 1 );
$name_neu .= $zeichen {$r};
$name_neu .= $zeichen[$r];
}
return $name_neu;
}