[TYPO3] function itemFromListinList()

Jérémy Lecour jeremy.lecour at gmail.com
Fri Aug 11 09:41:50 CEST 2006


Yes, it already exists : t3lib_div::inList($list,$item)

2006/3/20, Jo Schneider <typo3listmember at typo3cms.info>:
> Hello List,
>
> i was wondering, if there already is a function like this in TYPO3.
> Please let me know, if so. Or let me know, if there is a better way to
> do this. You may use this funktion as you like on you own risk.
>
>
> Best wishes!
> Jo
> ---
>
>     /**
>      * function itemFromListinList()
>      * Check for every item of a comma-separated list, if any item from list
>      * exists in a comma-separated list of items and returns count int
> of found items.
>      * jo.schneider at typo3cms.info 20MAR2006
>      * @param   string  $inList is the list, where to search in.
>      * @param   string  $fromList is the list, where there elements are
> taken from to find in $inList.
>      * @return  int     The amount of items found.
>      **/
>     function itemFromListinList($inList='',$fromList='') {
>         $fromListArr=t3lib_div::trimExplode(',',$fromList);
>         $count=0;
>         foreach($fromListArr as $item) {
>             if(t3lib_div::inList($inList,$item)) $count++;
>         }
>         return $count;
>     }
>
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>


-- 
Jérémy Lecour : <mailto:jeremy.lecour at gmail.com>
webdesigner, webmaster et développeur web
Trésorier du PLUG : Provence Linux User Group
http://www.plugfr.org/



More information about the TYPO3-english mailing list