The first person that responds, that can fix this problem successfully. I will send you $10 through paypal. Please see below, I am trying to avoid duplicate desiredjobposition returning. I only one each desiredjobposition to return only 1 time, excluding duplicates. $array = json_decode($json_string); //start of our select menu echo "<select>"; //Our Categories Menu foreach($array->results as $key => $object){ ?> <option value="<?PHP echo $object->meta_data-> desiredjobposition[0];?>"><?PHP echo $object->meta_data-> desiredjobposition[0];?></option> <?PHP } echo "</select>"; ?> PHP:
if this is a normal key => value array, you can just use, array_unique() http://php.net/manual/en/function.array-unique.php $array = json_decode($json_string); $unique = array_unique($array->results); //start of our select menu echo "<select>"; //Our Categories Menu foreach($unique as $key => $object){ ?> <option value="<?PHP echo $object->meta_data-> desiredjobposition[0];?>"><?PHP echo $object->meta_data-> desiredjobposition[0];?></option> <?PHP } echo "</select>"; ?> PHP:
http://www.backofficeexport.com/api/inapi/bei-api.php go to this link and you'll see the result. I limited the results though to 1. But the wpleads_desiredjobposition is what I am trying to get, only unique ones though. I mean not repeated over,over, over for every person.
$array = json_decode($json_string); $positions = array(); foreach($array->results as $key => $object){ if( !in_array($object->meta_data-> desiredjobposition[0], $positions) )}{ $positions[] = $object->meta_data-> desiredjobposition[0]; } } //start of our select menu echo "<select>"; //Our Categories Menu foreach($positions as $position){ ?> <option value="<?PHP echo $position; ?>"><?PHP echo $position; ?></option> <?PHP } echo "</select>"; ?> Code (markup): I'm assuming there that you are getting the correct text for $object->meta_data-> desiredjobposition[0] since i can't test right now