• Resolved petenam

    (@petenam)


    Howdy there.
    Whenever I use the multiselect I get the comma in between the selected values ex: value1, value2, value3

    Is there a way to remove it and only be left with an empy space between the values?

    Much Obliged
    PeteN

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Luke Carbis

    (@lukecarbis)

    Hi @petenam,

    If you’re using the block_field() function, Block Lab will output the value in a readable way, which in this case, includes commas.

    But if you use block_value() instead, Block Lab will only return the value (not output it), and in the case of a multiselect, it will be returned as an array.

    So, you could do something like this:

    
    $multiselect_value = block_value( 'multiselect' );
    echo implode( $multiselect_value, ' ' );
    

    Here, implode turns the array values into a string, with an empty space as the delimiter.

    Hope that helps!

    Thread Starter petenam

    (@petenam)

    Perfect!!!
    That did it

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove comma (,) from values’ is closed to new replies.