<?php header("Access-Control-Allow-Origin: *");
  header("Access-Control-Allow-Headers: *");  

  header('Content-Type: application/json');

  include '../db/connectMe.php';   
  include '../function/function.php';  

  //post comments

  if (@$_GET['p'] != "" ) {

      @$postId = mysql_prep($_GET['p']);

      $comments = find_all_post_comments($postId, 1); 

      exit(json_encode($comments));


  }else {
    exit(json_encode([]));
  }  




