![]() |
Parsing Multi-Select Profile Fields
Hey everyone!
I have a Multiple-Selection Menu profile field I want to grab data from and compare (the raw data for a custom PHP script). I am not quite sure how the data is store or how I would go about parsing the data I get from the field and utilizing it how I want. Does anyone know how I might do this? |
The data is stored as one number. You can think of it as a binary number where each bit represents one of your options. Look at this article: https://vborg.vbsupport.ru/showthread.php?t=250418 , specifically the section "For Multiple-Selection Menu and Multiple-Selection Checkbox", Method 2. The code for the plugin shows how you would check the value to see if each option is selected or not.
|
So essentially, let's say I grab my user's info from the field and store it as $multilist. Could I simply change the code provided as;
PHP Code:
PHP Code:
Edit: So, this is essentially a bitwise operator, and by the code provided, I am essentially seeing if the bit in my variable (in this case bit 1 in the variable $multilist) is set, and if it is, then that means that the user has selected it, right? Edit 2: It works! Thanks! |
Quote:
|
All times are GMT. The time now is 02:41 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|