0
I’m trying to call a variable into a function, but I’m making this mistake :
( ! ) Parse error: syntax error, Unexpected 'global' (T_GLOBAL), expecting Function (T_FUNCTION) or const (T_CONST)
<?php
/**
*
* Classe para obter dados do rank do PointBlank <pb.ongame.net>
* e recursos avançados. Requer PHP 5 ou superior.
*
* @author SkelletonX <[email protected]>
* @version 1.0 $ 2018-10-21 01:09:51 $
*/
class PB
{
global $PBURLCLAN = "https://pb.ongame.net/ranking/clan/678998/GhostStars/?ref=ranking-season";
public static function Clan_Info_Wrapper_Master(){
libxml_use_internal_errors(true);
$dom = new DOMDocument();
$dom->loadHTMLFile($PBURLCLAN);
$xpath = new DomXPath($dom);
$elements = $xpath->query('//div[@id="clan_info_wrapper"]/div[1]/div/div/div[2]/div/div[2]');
libxml_use_internal_errors(true);
if (!is_null($elements)) {
foreach($elements as $element){
$nodes = $element->childNodes;
foreach ($nodes as $node) {
echo $node->nodeValue. "\n";
}
}
}
}