Last active
August 29, 2015 14:02
-
-
Save FutureMedia/f79e7a30a0ea666489aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function extract_string_from_array($array_of_strings, $comparison){ | |
$array = array(); | |
foreach ($array_of_strings as $string): | |
if (strstr($string, $comparison)): | |
array_push($array, $string); | |
endif; | |
endforeach; | |
return $array; | |
} | |
//$another = extract_string_from_array($string, 'something-to-compare'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment