$jsonOrders = file_get_contents('templates/api/index.html.twig');
$orders = json_decode($jsonOrders); //,TRUE
foreach($orders as $order)
{
if($order->id == 1002)
{
$order->status = 'cancelled';
}
}
file_put_contents('templates/api/index.html.twig', json_encode($orders));
$sql = R::getAll( 'SELECT * FROM users, locations ORDER BY rand() LIMIT 3' );
foreach ($sql as $sq) {
echo $sq['names']." ".$sq['locations']."<br/>";
}