Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php string search in array

// Search a partial string matching in array elements
function array_search_partial($arr, $keyword) {
    foreach($arr as $index => $string) {
        if (strpos($string, $keyword) !== FALSE)
            return $index;
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #string #search #array
ADD COMMENT
Topic
Name
7+2 =