ya heres my second explaination....
you, the user is logged in...
this is the code...
Code: Select all
$ii = $personї'items'];
$iii = explode(", ", $ii);
$xp = 0;
while ($itemsї$xp] != ""){
if ($itemsї$xp] == "Space pod") {
// code, actually nothing right now but soo will be something
} else if ($itemsї$xp] == "Giant Space Ship") {
// referr to the comment above
} else if ($itemsї$xp] == "Royal Ship"){
// referr to the comment above
}
}
this is whats in the var $person['items'].. (note: example)
Code: Select all
id name thing items
1 jack nothing Giant Space Shipїht,e,d], Space Pod, Royal Shipїb]
as you can see if i explode it, and the separator being ", ", the feild items it would look like this
Code: Select all
$iiiї0] = Giant Space Shipїht,e,d]
$iiiї1] = Space Pod
$iiiї2] = Royal Shipїb ] // had to put the space becasue its bbcode
now i create the while loop becas ei wanted to loop through the $iii array... to find certian items... now all i need to know is if the item exists.. not what are in the [].
so back to my question is there a function or something that allows just to search for Giant Space Ship, and not have to worry about the rest, in the [].
like there are more than one users with Giant Space Ships, and there are different combinations of prefrences (the stuff in the []). so all i want to do is cut that part out, when i'm searchign through the array.
because if i try and do it with just if's, there's going to be a hell of alot of if's in the program. 'Cause there's ton's of different combinations, of prefrences, that one can have.
erg.. i hope someone gets it this time.