<?php

$arr = array("Apple","orange","strawberry");
$abc = '<table border="2">
            <tr>
                <th>Names</th>
            </tr>';
            foreach($arr as $key){
            $abc.='<tr>
                <td>'.$key.'</td>
            </tr>';
        }
        $abc.='</table>';

echo $abc;