I'm making a web app to create issues on my GitHub repo, the problem is I can't use the JSON string below this text because the GitHub API responds with "Cannot parse JSON".
I tried this code, this gave me the parse error (because single ticks (') are not working with JSON):
$jsonin = "{'title': '$mytitle','body': '$subject','labels': ['TEST']}";
$exec = shell_exec("curl -u username:AUTHTOKEN --data '$jsonin' https://api.github.com/repos/username/reponame/issues");
This code is working perfectly (it creates the issue), except it is (obviously) passing the string not the variable value ($mytitle and $subject):
$jsonin = '{"title": "$mytitle","body": "$subject","labels": ["TEST"]}';
$exec = shell_exec("curl -u username:AUTHTOKEN --data '$jsonin' https://api.github.com/repos/username/reponame/issues");
Any help is appreciated!