The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Is there some easier way?
I am wondering if there is an easier way to do the following than the way I have approached this, and if so would someone please share?
I have two string variables: $owned = '1,5,22'; $opted = '1,2,7'; What I need to do here is return true if one of the numbers in $opted matches one of the numbers in $owned. The way I am doing this check is as follows: 1) exploding both $owned and $opted 2) while looping through $ownedarray do a check for value in $opted array using in_array($value, $opted) PHP Code:
thanks |
#2
|
|||
|
|||
PHP Code:
|
#3
|
||||
|
||||
array_intersect() ... interesting. I will read up on the function at php.net - thanks for the idea Danny.VBT
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|