Men and women clothing brands on Nordstrom (19.07.2017)

Nordstrom has listed many clothing brands for men and women on their website, but do we know which of them specialize in both men and women clothing?

echo count($women_clothing_brands_nordstrom); // 387 echo count($men_clothing_brands_nordstrom); // 176 $common1 = array_intersect( $women_clothing_brands_nordstrom, $men_clothing_brands_nordstrom ); $common2 = array_filter(array_map(function($el) use ($women_clothing_brands_nordstrom) { if(in_array($el, $women_clothing_brands_nordstrom)) {return $el;} }, $men_clothing_brands_nordstrom)); sort($common1); sort($common2); echo $common1 === $common2; // 1 echo implode(', ', $common1); /* 7 For All Mankind®, A.P.C., AG, Armani Collezioni, Barbour, Burberry, Burberry Brit, Burberry London, Calvin Klein, Canada Goose, Citizens of Humanity, Current/Elliott, French Connection, Helmut Lang, Hudson Jeans, J Brand, James Perse, Joe's, Lanvin, Levi's®, Lucky Brand, Mavi Jeans, Michael Kors, Nike, North Face, Rick Owens, SPANX®, Santorelli, Ted Baker London, The Kooples, The North Face, Theory, Tommy Bahama, True Religion Brand Jeans, Under Armour, Versace, Vince, Vince Camuto, Vineyard Vines, rag & bone */ $men_women_brands_count = count($common1); $unique_brands_count = count(array_unique(array_merge( $women_clothing_brands_nordstrom, $men_clothing_brands_nordstrom ))); $percentage_men_women_brands = number_format(($men_women_brands_count / $unique_brands_count) * 100, 2); echo $men_women_brands_count; // 40 echo $unique_brands_count; // 522 echo "Percentage: {$percentage_men_women_brands}%"; // 7.66%