Created
March 18, 2016 11:36
-
-
Save tobsn/201f07cc1a100075ca44 to your computer and use it in GitHub Desktop.
clean up tags
This file contains 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
$var = 'zee,tv,Zee Khana Khazana,Mango,Kulfi,Khana Khazana (TV Program),Sanjeev Kapoor (Chef),Khoa (Dish),Condensed Milk (Invention),Mango Purée (Ingredient),Dessert (Type Of Dish)'; | |
$var = array_filter(array_map(function($v){$v=mb_strtolower(trim($v));return (strlen($v)>2)?$v:0;},explode(',',preg_replace('/\s\([^)]+\)/','',$var)))); | |
Array | |
( | |
[0] => zee | |
[2] => zee khana khazana | |
[3] => mango | |
[4] => kulfi | |
[5] => khana khazana | |
[6] => sanjeev kapoor | |
[7] => khoa | |
[8] => condensed milk | |
[9] => mango purée | |
[10] => dessert | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment