How to verify if words are in array and get array position value?

I’m trying to get the category_id of a product by checking whether the category_name is found in the product_name.

Take this array

$women_apparel = array('Tank Top', 'T-Shirt');

Now those 2 product_names :

$product_name1 = 'Next Level 6733 Ladies Triblend Racerback Tank Top';
$product_name2 = 'Los Angeles Apparel 2332 Fine Jersey Short Sleeve Cropped T-Shirt';

I’m trying this :

if (in_array($product_name1, $women_apparel)) {
 echo 'this product belongs to category X';
}

Desired Output :

Product 1 belongs to category 0
Product 2 belongs to category 1

How can I accomplish this dynamically (no hard-code)?

How to verify if words are in array and get array position value?