<form action="#" method="post">
<p>Enter the online list url (e.g: http://website.com/?subtopic=whoisonline)</p>
Website Url: <input type="text" name="url"><br>
<input type="submit">
</form>
<?php
if(!empty($_POST['url'])){
$searchfor = 'subtopic=characters&name=';
$filename = $_POST['url'];
$file = file_get_contents($filename);
$doc = new DOMDocument();
@$doc->loadHTML($file);
$divs = $doc->getElementsByTagName('div');
foreach($divs as $div) {
if ($div->getAttribute('class') === 'BoxContent') {
foreach($div->getElementsByTagName('a') as $a) {
$property=$a->getAttribute('href');
if (strpos($property , $searchfor)){
$remove_url = str_replace('?subtopic=characters&name=', '', $property);
$remove_plus = str_replace('+', ' ', $remove_url);
echo $remove_plus .'<br>';
}
}
}
}
}
?>