Search for a string or part of string in PHP

后端 未结 7 1655
春和景丽
春和景丽 2020-12-06 16:14

I am doing a very small online store application in PHP. So I have an array of maps in PHP. I want to search for a string (a product) in the array. I looked at array_search

7条回答
  •  抹茶落季
    2020-12-06 17:06

    iterate through the array and use substr if you want partial matches:

    http://php.net/manual/en/function.substr.php

    this should be sufficient if you have a "small" store...

提交回复
热议问题