purencool Posted August 17, 2009 Share Posted August 17, 2009 Hi, What function should can I use to search for a sub string in an array. I have been trying to use array_search but my the strings that I am looking for is surrounded by tags here is an example <li><a href='index?page="Home"'>Home</a></li> I am trying to search the word Home does anyone have any idea? Link to comment https://forums.phpfreaks.com/topic/170597-solved-searching-for-sub-string-in-array/ Share on other sites More sharing options...
purencool Posted August 17, 2009 Author Share Posted August 17, 2009 The answers is preg_grep it returns the key of the array $mod1 = preg_grep("/Home/",$menuArray); Link to comment https://forums.phpfreaks.com/topic/170597-solved-searching-for-sub-string-in-array/#findComment-899824 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.