먼저이 게시물을 읽은 모든 분들께 감사드립니다. 그리고 여기에 질문이 있습니다. 나는이 카테고리 배열 아래이 두 개의 표준 클래스에서 CATEGORY_ID을 얻고foreach를 사용하지 않고 std 클래스 값 받기
$categories = array(75,65);
같은 다른 배열에 추가하려고 것은 내가 foreach 문을 사용하지 않고 그들을 얻을 수 어쨌든 있나요? 이미 foreach에 있으며 다음 단계로 진행하려면이 카테고리가 필요합니다.
[categories] => Array
(
[0] => stdClass Object
(
[product_category_id] => 83125
[category_id] => 75
[product_id] => 10836
[ordering] => 2
[category_parent_id] => 51
[category_type] => product
[category_name] => Men boxer
[category_description] =>
[category_published] => 1
[category_ordering] => 3
[category_left] => 34
[category_right] => 35
[category_depth] => 5
[category_namekey] => product_1494167920_122781373
[category_created] => 1494167920
[category_modified] => 1502169524
[category_access] => all
[category_menu] => 0
[category_keywords] => men swimsuit, men swimming pants, swimsuit, men swimming suit, long sleeve swimming suit
[category_meta_description] => Buy men swimming suit at xxxxx, men long sleeve swimsuit and swimming boxer available, Buy 2 FREE shipping
[category_layout] =>
[category_page_title] => Men Swim Boxer - xxxxx
[category_alias] => men-boxer
[category_site_id] =>
[category_canonical] =>
[category_quantity_layout] =>
[hasbought] =>
)
[1] => stdClass Object
(
[product_category_id] => 83124
[category_id] => 65
[product_id] => 10836
[ordering] => 43
[category_parent_id] => 43
[category_type] => product
[category_name] => Accessory
[category_description] =>
[category_published] => 1
[category_ordering] => 5
[category_left] => 87
[category_right] => 114
[category_depth] => 4
[category_namekey] => product_1476761078_750345878
[category_created] => 1476761078
[category_modified] => 1502169605
[category_access] => all
[category_menu] => 0
[category_keywords] => accessory, beach accessory, swimming accessory, xxxx
[category_meta_description] => Shop accessory at xxxx, beach accessory, fashion accessory, gym accessory and many more, Free shipping & speed delivery
[category_layout] =>
[category_page_title] => Accessory - xxxxxxx
[category_alias] => accessory
[category_site_id] =>
[category_canonical] =>
[category_quantity_layout] =>
[hasbought] =>
)
)
왜 foreach 내부에서 다른 foreach를 사용하지 않으시겠습니까? – Geshode
@Geshode 처리 속도가 떨어질 까봐 두렵습니다. –
속도를 상당히 낮추거나 내려 주면 시도해보십시오. – Geshode