如何使用HTML表单输入获取json_decode和OOP语句

I have a simple HTML form using json_encode to send a PHP variable (via value=) to a file and then using json_decode to extract and echo the results. I am battling to get the correct syntax or method to decode the json_decode in the object environment, required by Opencart. It works fine when I use the procedural method below.

I have attempted various syntax changes, but they return errors, so I believe that the syntax is incorrect, or my method cannot be done this way. 1st Code is the Procedural method that returns the correct result. 2nd code is the OOP method which fails. - (assume syntax is wrong.

Code Working:-
  <form id="myForm" action="radio_result.php" method="post" 
  enctype="multipart/form-data">
  <input type="radio" name="service" value="<?php echo 
  htmlentities(json_encode($service_onx));?>"> ONX
//additional code excluded.
radio_result.php // not all code shown
  <?php   
    if(!empty($_POST['service'])) {
    $service = json_decode($_POST['service'], true);
    print_r($service);

Code failing:-
    <form id="myForm" action="index.php?route=checkout/checkout" 
    method="post" enctype="multipart/form-data">
    <input type="radio" name="service" value="<?php echo 
    htmlentities(json_encode($service_onx));?>"> ONX
    checkout.php // not all code shown
    $this->session->data['service'] = (isset($this->request- 
   >post(json_decode(['service'])))) ? $this->request->post['service'] : 
"not_set";
    $data['onx'] = $this->session->data['service'][0];
    $data['eta'] = $this->session->data['service'][1];
Error result:-
Fatal error: Cannot use isset() on the result of an expression (you can 
use "null !== expression" instead) in 
    C:\wamp64\www\catalog\controller\checkout\checkout.php on line 101


I would like to get the json_decode working in the Opencart framework 
checkout.php so that I can use the reult further.

If I understand you correctly, you need an object?If so you can first do

$service = json_decode($_POST['service'], true);

And than cast this array as an object:

$serviceObject = (object) $service;

And you will have an object. Try it out.

Had a similar problem. Solved it by also encoding/decoding on base64. base64_encode(json_encode($string)) and the json_decode(base64_decode($string))