<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<?php  
 //excel.php  
 header('Content-Type: application/vnd.ms-excel');  
 header('Content-disposition: attachment; filename='.rand().'.xls');  

    $a  = $_GET["data"];
    if($a == "123"){
        ?>
        <table cellpadding="0" cellspacing="0" border="1" class="table">
            <thead>
                <tr>
                    <td>Name</td>
                    <td>Roll</td>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>arun</td>
                    <td>123</td>
                </tr>
            </tbody>
        </table>
        <?php
    }
    else { ?>
            <table cellpadding="0" cellspacing="0" border="1">
            <thead>
                <tr>
                    <td>Name</td>
                    <td>Roll</td>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>arunasdf</td>
                    <td>123adsf</td>
                </tr>
            </tbody>
        </table>
    
    <?php
        
    }
 ?> 