<?php 
include_once('libs/main.php');
$restaurantList = $conn->execute('SELECT name,id FROM tbl_restaurant WHERE 1=1 AND status = 1');
$dataD =  '[';
  foreach($restaurantList as $restaurant){
	  if($dataD == '['){
		 $dataD .='{
			"name":"'.$restaurant->name.'",
			"id": "'.$restaurant->id.'"
		  }';
		 }else{
			$dataD .=',{
				"name":"'.$restaurant->name.'",
				"id": "'.$restaurant->id.'"
			  }'; 
		 }
	  
  }
$dataD .= ']';
echo $dataD;
?>