Support

Account

Home Forums Front-end Issues Value return number(index) instead word's Reply To: Value return number(index) instead word's

  • i’ve found this code for checkbox, my field named “engineering”:

    <div><?= $field = get_field_object('engineering');
    $value = $field['value'];
    $choices = $field['choices'];
    if( $value ):?>
    <?php foreach( $value as $v ): ?> , <?php echo $choices[ $v ]; ?><?php endforeach; ?>.<?php endif; ?> </div>

    in result i see:

    Array, value1, value2.
    why i see “array”?