有什么方法可以翻译API响应上的订单状态
“https://test.com/wp-json/wc/v3/orders “.
{
“status”: “processing”,
}
谢谢
答案 0 :(得分:0)
为了在PHP中使用它,我们需要将其转换为PHP可以理解的格式。为此,我们可以使用json_decode()函数。
$json = '{"key":"value"}';
// Translate into an object
$obj = json_decode( $json );
// Translate into an array
$array = json_decode( $json, true );