fork download
  1. <?php
  2.  
  3. >>388246
  4.  
  5. Тебе нужно просто сделать и возвращать объект с методами toJson/toXml:
  6.  
  7. return ApiResponse::error('Access denied');
  8.  
  9. $response = new ApiReponse;
  10. $response->setError(ApiReponse::ERROR_ACCESS, 'Access denied');
  11. return $response;
  12.  
  13. $response = new ApiReponse();
  14. $response->setSuccess();
  15. $response->addModel('user', $userInfo);
  16. return $response;
  17.  
  18.  
Runtime error #stdin #stdout #stderr 0.01s 20552KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Parse error:  syntax error, unexpected '>>' (T_SR) in /home/cfKfzb/prog.php on line 3