以下是我的计划var_dump($myvar):
f_shopping array(2) {
["product-size"]=> array(3) {
[۰]=> object(WP_Term)#20766 (11) {
["term_id"]=> int(45)
["name"]=> string(8) "Large"
["slug"]=> string(5) "l"
["term_group"]=> int(0)
["term_taxonomy_id"]=> int(45)
["taxonomy"]=> string(13) "pa_product-size"
["description"]=> string(0) ""
["parent"]=> int(0)
["count"]=> int(2)
["filter"]=> string(3) "raw"
["meta_value"]=> string(1) "0"
}
[۱]=> object(WP_Term)#20791 (11) {
["term_id"]=> int(47)
["name"]=> string(8) "Small"
["slug"]=> string(5) "s"
["term_group"]=> int(0)
["term_taxonomy_id"]=> int(47)
["taxonomy"]=> string(13) "pa_product-size"
["description"]=> string(0) ""
["parent"]=> int(0)
["count"]=> int(2)
["filter"]=> string(3) "raw"
["meta_value"]=> string(1) "0"
}
[۲]=> object(WP_Term)#20780 (11) {
["term_id"]=> int(46)
["name"]=> string(10) "Medium"
["slug"]=> string(6) "m"
["term_group"]=> int(0)
["term_taxonomy_id"]=> int(46)
["taxonomy"]=> string(13) "pa_product-size"
["description"]=> string(0) ""
["parent"]=> int(0)
["count"]=> int(2)
["filter"]=> string(3) "raw"
["meta_value"]=> string(1) "0"
}
}
["shopping-pack"]=> array(4) {
[۰]=> object(WP_Term)#20751 (11) {
["term_id"]=> int(26)
["name"]=> string(13) "Box"
["slug"]=> string(3) "b"
["term_group"]=> int(0) ["term_taxonomy_id"]=> int(26)
["taxonomy"]=> string(16) "pa_shopping-pack"
["description"]=> string(0) ""
["parent"]=> int(0)
["count"]=> int(1)
["filter"]=> string(3) "raw"
["meta_value"]=> string(1) "1"
}
[۱]=> object(WP_Term)#20750 (11) {
["term_id"]=> int(25)
["name"]=> string(12) "Kilos"
["slug"]=> string(4) "k"
["term_group"]=> int(0)
["term_taxonomy_id"]=> int(25)
["taxonomy"]=> string(16) "pa_shopping-pack"
["description"]=> string(0) ""
["parent"]=> int(0) ["count"]=> int(1)
["filter"]=> string(3) "raw"
["meta_value"]=> string(1) "2"
}
[۲]=> object(WP_Term)#20749 (11) {
["term_id"]=> int(24)
["name"]=> string(13) "Single"
["slug"]=> string(6) "s"
["term_group"]=> int(0)
["term_taxonomy_id"]=> int(24)
["taxonomy"]=> string(16) "pa_shopping-pack"
["description"]=> string(0) ""
["parent"]=> int(0)
["count"]=> int(2)
["filter"]=> string(3) "raw"
["meta_value"]=> string(1) "3"
}
[۳]=> object(WP_Term)#20748 (11) {
["term_id"]=> int(73)
["name"]=> string(13) "Packed"
["slug"]=> string(6) "p"
["term_group"]=> int(0)
["term_taxonomy_id"]=> int(73)
["taxonomy"]=> string(16) "pa_shopping-pack"
["description"]=> string(0) ""
["parent"]=> int(0)
["count"]=> int(1)
["filter"]=> string(3) "raw"
["meta_value"]=> string(1) "4"
}
}
我如何在[" product-size"]和[" shopping-pack"]中将所有[" name"]存储在两个单独的简单中数值为" slug"作为关键和"名称"作为价值?
我之前搜索过并尝试过。解决方案没有成功。
答案 0 :(得分:0)
您可以使用array_column
$product = array_column($myVar['product-size'],'name','slug');
print_r($product);
$shopping = array_column($myVar['shopping-pack'],'name','slug');
print_r($shopping);
答案 1 :(得分:0)
也许这对你有帮助:
function Get-OutlookInBox {
Add-Type -AssemblyName "Microsoft.Office.Interop.Outlook" | Out-Null
$olFolders = "Microsoft.Office.Interop.Outlook.olDefaultFolders" -as [type]
$Outlook = New-Object -ComObject Outlook.Application
$Namespace = $Outlook.GetNameSpace("MAPI")
$folder = $NameSpace.pickfolder()
$Folder.Items | Get-Member
$Folder.Items |
Select-Object Subject, SenderName, SenderEmailAddress, CreationTime,
ReceivedTime, Final-recipient, UserProperties, ItemProperties,
MAPIOBJECT, ReceivedByName, Recipents, Sender, SentOn,
SentOnBehalfOfName |
Export-CSV -NoTypeInformation xxx\Trial.csv
}