0

Excuse my question but I'm quite a novice. I would like the values ​​to be separated with commas and not with jumps. This is how it should turn out: Blue, Green, Black
and not like that Blue Green Black

<?php echo esc_url( $business_data['delivery'] );?>
<i class="fa fa-globe" aria-hidden="true"></i> 
<?php print_r ( $business_data['Blue'] ); echo"\n"; ?>
<?php print_r ( $business_data['Green'] ); echo"\n"; ?>
<?php print_r ( $business_data['Black'] );
foreach($business_data['delivery']  as $value){ 
    echo $value . "<br />\n";
}?>
Nick
  • 138,499
  • 22
  • 57
  • 95
pablo79py
  • 5
  • 4
  • Sorry about closing, I hadn't noticed the code off to the right that you were asking about. I've reformatted your question to make it obvious, and reopened it. – Nick May 12 '20 at 00:23
  • [`print_r()`](https://www.php.net/manual/en/function.print-r) is a statement used for debug. – axiac May 12 '20 at 00:27

1 Answers1

0

Something like this:

<?php
    echo esc_url($business_data['delivery']);
?>

<i class="fa fa-globe" aria-hidden="true"></i> 

<?php
    echo $business_data['Blue'].",".$business_data['Green'].",".$business_data['Black']."\n";
    foreach ($business_data['delivery'] as $value) {
        echo $value . ",\n";
    }
?>
Alberto Sinigaglia
  • 12,097
  • 2
  • 20
  • 48