Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/238.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用explode from external site时如何剥离div类_Php_Explode - Fatal编程技术网

Php 使用explode from external site时如何剥离div类

Php 使用explode from external site时如何剥离div类,php,explode,Php,Explode,我想删除所有的div类和id,最好将内容作为列表 我将非常感谢你的帮助,因为我现在正把头撞在墙上 $result = file_get_contents("https://www.lottery.ie/dbg/results/view?game=daily-million&draws=1") ; $bonusNumber = $ex3 = ''; /* * **** Result Get With url********* */ if ($result) { $

我想删除所有的div类和id,最好将内容作为列表

我将非常感谢你的帮助,因为我现在正把头撞在墙上

$result = file_get_contents("https://www.lottery.ie/dbg/results/view?game=daily-million&draws=1") ;

$bonusNumber = $ex3 = '';
/*         * **** Result Get With url********* */
if ($result) {
    $ex1 = explode('<section class="matching-draw">', $result);
    if ($ex1['1']) {
        $ex2 = explode('<h4>', $ex1['1']);
        $ex3 = explode('</h4>', $ex2['1']); /*                 * **Date get here*** */
    }
}

if (!empty($ex3)) {
    $dateVal = $ex3['0'];
    $allNumber = explode('<h5>WINNING NUMBERS</h5>', $ex3['1']);
    $allNumber1 = explode('<div class="pick-number">', $allNumber['1']); //pr($allNumber1);


    foreach ($allNumber1 as $no) {  
        $ball[] = explode('</div>', $no);
    }
    $ex4 = explode('<h5>BONUS</h5>', $ex3['1']);
    if ($ex4) {
        $ex5 = explode('</div>', $ex4['1']);
        if ($ex5) {
            $ex6 = explode('<div class="pick-number">', $ex5['0']);
            $bonusNumber = $ex6['1']; /*                     * ****Final Bonus Number******** */
        }
    }
}


if (!empty($bonusNumber)) {
    echo 'Winning Numbers<br/>';
    echo $ball['1']['0'] . ' ' . $ball['2']['0'] . ' ' . $ball['3']['0'] . ' ' . $ball['4']['0'] . ' ' . $ball['5']['0'] . ' ' . $ball['6']['0'] . '<br/>';
    echo 'Bonus<br/>';
    echo $bonusNumber;
$result=文件获取内容(“https://www.lottery.ie/dbg/results/view?game=daily-百万英镑&提款=1“;
$bonusNumber=$ex3='';
/*******使用url获取结果********/
如果($结果){
$ex1=爆炸(“”,$result);
如果($ex1['1'])){
$ex2=爆炸(“”,$ex1['1']);
$ex3=爆炸(“”,$ex2['1']);/****到达日期****/
}
}
如果(!空($ex3)){
$dateVal=$ex3['0'];
$allNumber=explode('winding NUMBERS',$ex3['1']);
$allNumber1=explode(“”,$allNumber['1']);//pr($allNumber1);
foreach($allNumber1作为$no){
$ball[]=爆炸(“”,$no);
}
$ex4=爆炸('BONUS',$ex3['1']);
如果有的话($ex4){
$ex5=爆炸(“”,$ex4['1']);
如果有的话($ex5){
$ex6=爆炸(“”,$ex5['0']);
$bonusNumber=$ex6['1'];/*******最终奖金号码********/
}
}
}
如果(!空($bonusNumber)){
回音“中奖号码
”; 回音$ball['1']['0'].'..$ball['2']['0'.'.'.$ball['3']['0'.'.'.'.$ball['4']['0'.'.$ball['5']['0'.$ball['6']['0'.
; 回声“奖金
”; echo$bonusNumber;