mercredi 30 décembre 2020

how to check if array contains multi strings Laravel

i have collection

Illuminate\Support\Collection {#1453
  #items: array:4 [
    0 => "three"
    1 => "nine"
    2 => "one"
    3 => "two"
  ]
}

and this string

'one', 'two', 'three'

i am trying to validate if these all strings available in array

$array->contains('one', 'two', 'three')

it should return true

but everytime i am getting false

what i am doing wrong please explain thank you



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3pDqS94
via IFTTT

Aucun commentaire:

Enregistrer un commentaire