0

I have array which contains different text and I want to search given text from array but I can not success

Here is my code

$search_word= "Joust Bag";
$data = array("Foo", "Joust Duffle Bag","Bag", "Wayfarer Messenger", "Voyage Yoga", "pushit Messagenger");

preg_match("/(.*)$search_word(.*)/", $data, $output_array);

echo print_r($output_array); // it should be return "Bag" and "Joust Bag"
Niraj Patel
  • 65
  • 14

0 Answers0