I am working on a restApi and i am using this api for my mobile and web development.which is build in PHP.i need my error in json format so that i can send this error in a proper response format to android developer and they can also easily handle it.so we will not face any crashing issue in our mobile app.
this is what i need exactly.
PHP ERROR:
Parse error: syntax error, unexpected 'switch' (T_SWITCH) in /var/www/html/phishem/index.php on line 68
What need:
{error_code:"403",message:"Parse error: syntax error, unexpected 'switch' (T_SWITCH) in /var/www/html/phishem/index.php on line 68"}
So how i convert this php error in json response.