mercredi 27 mai 2020

Get the word from sentence that match to an array PHP

Currently I have this variable in php

   @if(count($label_types) > 0)
   @foreach ($label_types as $label_type)
      @if($label_type)
        
      @endif
   @endforeach
   @endif

Which contains the following rows

Waterproof (This is waterproof)

Glossy

Normal

Now since waterproof has the (This is waterproof) on the records

Now I want to only return the words that matches with these keywords

waterproof, glossy, normal

whether they are uppercases, lowercases

For example if the case is : waterproofss with double s

the return would be waterproof



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire