simulator response sms - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of simulator response sms.php

  1. <?php
  2. $error_desc = [1 => 'Success',0 => 'Failed'];
  3. $status = rand(0,1);
  4.  
  5. $response = ['result' => $status,'error_code' => $error_desc[$status]];
  6. echo json_encode($response);
File Description
  • simulator response sms
  • PHP Code
  • 12 Aug-2019
  • 179 Bytes
You can Share it: