title: parse data from JSON callback using PHP
body: <p>I receive a callback data from payment site and try to save some values into txt file</p>
  
  <p>Getting an array:</p>
  
  <pre><code>$json = file_get_contents('php://input');
  
  $obj = json_decode($json,true);
  </code></pre>
  
  <p>Saving all data to txt: </p>
  
  <p><code>file_put_contents('robot.php', var_export($obj, true) . "\r\n\r\n", FILE_APPEND | LOCK_EX);</code></p>
  
  <p>The result from txt:</p>
  
  <pre><code>array (
    'rrn' =&gt; '',
    'masked_card' =&gt; '444455XXXXXX1111',
    'sender_cell_phone' =&gt; '',
    'response_status' =&gt; 'success',
    'sender_account' =&gt; '',
    'fee' =&gt; '',
    'rectoken_lifetime' =&gt; '',
    'reversal_amount' =&gt; '0',
    'settlement_amount' =&gt; '0',
    'actual_amount' =&gt; '370000',
    'order_status' =&gt; 'approved',
    'response_description' =&gt; '',
    'verification_status' =&gt; '',
    'order_time' =&gt; '04.01.2018 21:53:47',
    'actual_currency' =&gt; 'JPY',
    'order_id' =&gt; 1515095627',
    'parent_order_id' =&gt; '',
    'merchant_data' =&gt; '[{"name":"custom-field-0","label":"fist_name","value":"john_doe"},{"name":"custom-field-2","label":"phone","value":"07777777777"}]',
    'tran_type' =&gt; 'purchase',
    'eci' =&gt; '5',
    'settlement_date' =&gt; '',
    'payment_system' =&gt; 'card',
    'rectoken' =&gt; '',
    'approval_code' =&gt; '56783909',
    'merchant_id' =&gt; 14066776208,
    'settlement_currency' =&gt; '',
    'payment_id' =&gt; 7487818gg3,
    'product_id' =&gt; '',
    'amount' =&gt; '370000',
    'sender_email' =&gt; 'admin@none.in.ua',
  )
  </code></pre>
  
  <p>How to save in txt separate values from nested array 'merchant_data' - first name and phone? </p>