<table>
<?php
$sourceURL="https://animepahe.ru/play/09622f13-70b2-c605-4ee7-62fdc3068671/";
$content=file_get_contents($sourceURL);
$content = strip_tags($content,"<a>");
$subString = preg_split("/<\/a>/",$content);
$links = [];
foreach ( $subString as $val ){
if( strpos($val, "<a href=") !== FALSE ){
$val = preg_replace("/.*<a\s+href=\"/sm"," ",$val);
$val = preg_replace("/\".*/","",$val);
if (strpos($val, "play") !== false && !in_array($val, $links)) {
$links[] = $val;
$output = '<tr><td>'.$val."\n";
if(count($links) == 1){
continue;
}elseif(count($links) == 2){
$temp = $output;
}
$temp2 = $output;
$output = $temp;
$temp = $temp2;
if(count($links) == count($subString) - 1){
$output = $temp;
}
print $output;
}
}
}
?>
</table>