@apmuthu, I was right. The problem was not of PHP.
This Post helped me. STACK OVERFLOW
now facurlrest.php looks like below
<?php
// FrontAccounting Bridge REST Test Script
// Author: Ap.Muthu
// Website: www.apmuthu.com
// Release Date: 2012-11-28
include_once "fabridge.php";
$method = isset($_GET['m']) ? $_GET['m'] : 'g'; // g, p, t, d => GET, POST, PUT, DELETE
$action = isset($_GET['a']) ? $_GET['a'] : '';
$record = isset($_GET['r']) ? $_GET['r'] : '';
$filter = isset($_GET['f']) ? $_GET['f'] : false;
$data = array(
'trans_type' => '10',
'ref'=> 'NoGuia0001',
'customer_id'=> '78',
'branch_id'=> '78',
'location'=> 'DEF',
'deliver_to'=> 'ABC, S.A. DE C.V.',
'delivery_date'=> '09/11/2019',
'delivery_address'=> 'Karachi',
'order_date'=> '09/11/2019',
'phone'=> '',
'cust_ref'=> '',
'comments'=> '',
'ship_via'=> '1',
'payment'=> '1',
'sales_type'=> '1',
'items'=> array
(
0 => array
(
'stock_id'=> '2801',
'description'=> 'iPhone',
'qty'=> '1',
'price'=> '100',
'discount'=> '0'
),
1 => array
(
'stock_id'=> '2802',
'description'=> 'Samsung',
'qty'=> '1',
'price'=> '100',
'discount'=> '0'
),
),
);
$data = http_build_query($data);
$output = fa_bridge($method, $action, $record, $filter, $data);
?>