Lottery numbers php

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, “https://www.lotteryusa.com/”);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
$html = curl_exec($curl);
curl_close($curl);
$dom = new DOMDocument;
@$dom->loadHTML($html);
$xpath = new DOMXPath($dom);
echo ‘

‘;
echo ‘

‘.’POWERBALL WINNING NUMBERS’.’

‘;
$img=”https://viralpanda.net/wp-content/uploads/2023/04/powerball.svg”;
$dollar=”https://viralpanda.net/wp-content/uploads/2023/04/money-bag.png”;
echo ‘

.

‘;
$x = 1;
foreach ($xpath->query(‘//time[contains(@class, “c-result-card__sub-title”)]’) as $div)
{
$x=$x+1;
if($x % 2==0)
{
echo ‘DRAW Date: ‘.$div->textContent.’‘;
}
}
echo ‘

‘;
$x=0;
foreach ($xpath->query(‘//li[contains(@class, “c-ball c-ball–default c-result__item c-ball–lg”)]’) as $li)
{
if($x<5) { echo '‘.$li->textContent.’‘.’ ‘;
}
$x=$x+1;
}
foreach ($xpath->query(‘//span[contains(@class, “c-ball c-ball–lg c-ball–red c-ball–“)]’) as $span) //Powerball number
{
echo ‘‘.$span->textContent.’‘;
}
echo ‘PB’;
echo ‘
‘;
$x=0;
foreach ($xpath->query(‘//li[contains(@class, “c-result__multiplier”)]’) as $li) //Power Play
{
if($x<1){ echo '‘.$li->textContent.’‘;
}$x=$x+1;
}
echo ‘
‘;
$x=1;
foreach ($xpath->query(‘//dd[contains(@class, “c-result-card__prize-value”)]’) as $div)
{
if($x==1)
{
echo ‘‘;
echo ‘ Current Est. Jackpot: ‘.$div->textContent;$x=$x+1;echo ‘
‘;
} elseif($x==2)
{
echo ‘



‘;
echo ‘

‘;
echo ‘‘; echo ‘ Next Est. Jackpot: ‘.$div->textContent;$x=$x+1;
}
}
echo ‘
‘;
$x = 1;
foreach ($xpath->query(‘//time[contains(@class, “c-result-card__title”)]’) as $div) //next dates
{
if($x==1){
echo ‘Next Powerball Draw Date: ‘.$div->textContent.’

‘; //div cent
}
$x = 1+$x;
}
echo ‘

‘; //box2
echo ‘

‘;

/////MEGA MIOO

echo ‘

‘.’MEGAMILLIONS WINNING NUMBERS ‘.’

‘;
$imgm=”https://viralpanda.net/wp-content/uploads/2023/04/megamillions.svg”;
echo ‘

.

‘;
$x = 1;
foreach ($xpath->query(‘//time[contains(@class, “c-result-card__sub-title”)]’) as $div)
{
$x=$x+1;
if($x % 2!=0)
{
echo ‘DRAW Date: ‘.$div->textContent.’
‘;
}
}
echo ‘
‘;
$x=0;
foreach ($xpath->query(‘//li[contains(@class, “c-ball c-ball–default c-result__item c-ball–lg”)]’) as $li)
{
$x=$x+1;
if($x>5)
{
echo ‘‘.$li->textContent.’‘.’ ‘; //mega numbers
}
}
foreach ($xpath->query(‘//span[contains(@class, “c-ball c-ball–lg c-ball–yellow c-ball–“)]’) as $span)
{
echo ‘‘.$span->textContent.’‘; //mega final
}
echo ‘MB’;
echo ‘
‘;
$x=0;
foreach ($xpath->query(‘//li[contains(@class, “c-result__multiplier”)]’) as $li)
{
if($x==1){
echo ‘‘.$li->textContent.’‘;
}
$x=$x+1;
}
echo ‘
‘;
$x=0;
foreach ($xpath->query(‘//dd[contains(@class, “c-result-card__prize-value”)]’) as $div)
{
$x=$x+1;
if($x>=3 && $x<4) { echo '‘;
echo ‘ Current Est. Jackpot: ‘.$div->textContent;echo ‘
‘;
} elseif($x>3 && $x<=4) { echo '

‘;
echo ‘

‘;
echo ‘‘; echo ‘ Next Est. Jackpot: ‘.$div->textContent;
}
}
echo ‘
‘;
$x = 1;
foreach ($xpath->query(‘//time[contains(@class, “c-result-card__title”)]’) as $div) //next dates
{
if($x>1){
echo ‘Next Draw Date: ‘.$div->textContent.’

‘; //end cent div
}
$x = 1+$x;
}
echo ‘

‘; //box2