<?php
if(isset($_POST['send']))
{
$string = "
{
'title': 'test',
'message': 'test'
}";
$data = json_decode($string, true);
header('Content-Type: application/json');
}
?>
<form action="https://site.com" method="POST">
<button name="send" type="submit">send</button>
</form>