Support the ongoing development of Laravel.io →
Eloquent Blade
Last updated 1 year ago.
0

Is this an option?

{{ implode(",", $splits) }}
Last updated 1 year ago.
0

Yep it works!

Last updated 1 year ago.
0

gpluess said:

Is this an option?

{{ implode(",", $splits) }}

how can i set two rules, for example one with ", " and other with "," so one with space and one without

Last updated 1 year ago.
0

{{ implode(",", $splits) }} = no space.

{{ implode(", ", $splits) }} = with space.

Can you clarify what you mean with "so one with space and one without" please?

Last updated 1 year ago.
0

Try

rtrim($string, ",")
Last updated 1 year ago.
0

tonydew said:

{{ implode(",", $splits) }} = no space.

{{ implode(", ", $splits) }} = with space.

Can you clarify what you mean with "so one with space and one without" please?

One rule is with comma and space, for example "happy, angry", and other is for comma without space after it "happy,angry"

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.