Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何从字符串php中获取值_Php_Magento - Fatal编程技术网

如何从字符串php中获取值

如何从字符串php中获取值,php,magento,Php,Magento,如何从$order->getPayment()->getMethodInstance()获取价值? 我有一份打印的报税表: [credit_card_token] => 849832748932uhdfhsiufhi [credit_card_owner] => NoNoNoNo [installment_quantity] => 2 [installment_value] => 98.11 ) ); etc 我需要分期付款数量和分期付款金额中的值 谢谢该方法将返回所需

如何从$order->getPayment()->getMethodInstance()获取价值? 我有一份打印的报税表:

[credit_card_token] => 849832748932uhdfhsiufhi [credit_card_owner] => NoNoNoNo [installment_quantity] => 2 [installment_value] => 98.11 ) ); etc
我需要分期付款数量和分期付款金额中的值


谢谢

该方法将返回所需的数组,因此只需将其分配给变量并访问所需的项:

$data = $order->getPayment()->getMethodInstance();

$quantity = $data['installment_quantity'];
$value = $data['installment_value'];

该方法返回所需的数组,因此只需将其分配给变量并访问所需的项:

$data = $order->getPayment()->getMethodInstance();

$quantity = $data['installment_quantity'];
$value = $data['installment_value'];

该方法返回所需的数组,因此只需将其分配给变量并访问所需的项:

$data = $order->getPayment()->getMethodInstance();

$quantity = $data['installment_quantity'];
$value = $data['installment_value'];

该方法返回所需的数组,因此只需将其分配给变量并访问所需的项:

$data = $order->getPayment()->getMethodInstance();

$quantity = $data['installment_quantity'];
$value = $data['installment_value'];
这个“
$order->getPayment()->getMethodInstance()
”返回数组,所以您需要将其分配给一个变量,并使用键获取值

$credit_card_info=$order->getPayment()->getMethodInstance();
现在您可以使用键获取值。

$credit_card_token=$credit_card_info['credit_card_token'];
$credit_card_owner=$credit_card_info['credit_card_owner'];
这个“
$order->getPayment()->getMethodInstance()
”返回数组,所以您需要将其分配给一个变量,并使用键获取值

$credit_card_info=$order->getPayment()->getMethodInstance();
现在您可以使用键获取值。

$credit_card_token=$credit_card_info['credit_card_token'];
$credit_card_owner=$credit_card_info['credit_card_owner'];
这个“
$order->getPayment()->getMethodInstance()
”返回数组,所以您需要将其分配给一个变量,并使用键获取值

$credit_card_info=$order->getPayment()->getMethodInstance();
现在您可以使用键获取值。

$credit_card_token=$credit_card_info['credit_card_token'];
$credit_card_owner=$credit_card_info['credit_card_owner'];
这个“
$order->getPayment()->getMethodInstance()
”返回数组,所以您需要将其分配给一个变量,并使用键获取值

$credit_card_info=$order->getPayment()->getMethodInstance();
现在您可以使用键获取值。

$credit_card_token=$credit_card_info['credit_card_token'];
$credit_card_owner=$credit_card_info['credit_card_owner'];