4,156 questions
4,369 answers
5,718 comments
You have code to do exactly this in the MultiChain Web Demo:
https://github.com/MultiChain/multichain-web-demo/blob/master/functions.php
See the function json_rpc_send() in that file.