我需要一个公式,该公式将A1复制到B1,同时删除“ -text3”(第二个破折号和其后的文本。“ text-text-text”格式在A列中保持一致)。 text1,text2和text3分别表示各种不一致的字符串。
function d($var){var_dump($var);}
$woocommerce = new Client(
"https://{$domain}.com/",
$ckey,
$csec,
array( 'wp_api' => true
,'version' => 'wc/v2'
,'verify_ssl' => false
,'queryStringAuth' => false
)
);
try {
$results = $woocommerce->get('orders');
} catch (HttpClientException $e) {
d( $e->getMessage() );
// Error: Sorry, you cannot list resources. [woocommerce_rest_cannot_view]
d( $e->getRequest()->getUrl() );
// https://example.com/wp-json/wc/v2/orders
d( $e->getRequest()->getparameters() );
// empty array
}
$res = json_decode(file_get_contents("https://{$domain}.com/wp-json/wc/v2/orders?consumer_key={$ckey}&consumer_secret={$csec}&per_page=99"));
d($res );
// works, full list of orders.