gpt4 book ai didi

php - 拉动 from atom feed with simple pie

转载 作者:行者123 更新时间:2023-12-04 06:24:29 26 4
gpt4 key购买 nike

如何使用简单的饼图从下面的 s:variant 块中获取标题标签?

<s:variant>
<id>product_variants-96590662</id>
<title>Default Title</title>
<s:price currency="GBP">10.00</s:price>
<s:sku>002</s:sku>
<s:grams>0</s:grams>
</s:variant>

我已经尝试了以下方法,还有“变体”和“s”
$caption = $item->get_item_tags('http://www.w3.org/2005/Atom', 's:variant');

有问题的提要是 here (来自 shopify),get_item_tags 上的文档是 here .

最佳答案

您可以读取 s 的 xml 命名空间来自 <feed>标签。

<feed xmlns:s="http://jadedpixel.com/-/spec/shopify" xml:lang="en-US" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://www.w3.org/2005/Atom">

根据它你必须使用 http://jadedpixel.com/-/spec/shopify作为 get_item_tags() 中的命名空间参数,第二个参数是没有 s: 的标签名.
$varinat = $item->get_item_tags('http://jadedpixel.com/-/spec/shopify', 'variant');

关于php - 拉动 <s :variant> from atom feed with simple pie,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6199064/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com