I need to create a comma separated string of numbers.
The issue I'm running into is that, in the end, I'm getting a total of all the numbers when it should be like:
2, 10, 35, 56, 67', etc.
Here's what I'm doing:
$field_ids = '';
// begin while loop
<?php $field_ids = bp_get_the_profile_field_ids(); ?>
// end while loop
// begin while loop
<?php $field_ids += bp_get_the_profile_field_ids(); ?>
// end while loop
<input type="hidden" name="field_ids" id="field_ids" value="<?php echo $field_ids; ?>">
How can I get this:
<input type="hidden" name="field_ids" id="field_ids" value="2, 10, 35, 56, 67">
instead of this:
<input type="hidden" name="field_ids" id="field_ids" value="170">