SpencerChantler123
SpencerChantler123

Reputation: 366

Building a string from an array in laravel

This is the array i've received in my controller from doing a POST which is built dynamically based on the number of inputs given by the user. sample_array

I would like to convert it into a string in my controller which would produce something like "test3 or test2 or test" to use in a PHP exec.

Upvotes: 1

Views: 71

Answers (1)

Alexey Mezenin
Alexey Mezenin

Reputation: 163788

You can use implode():

implode(' or ', $array['emailVal'])

Upvotes: 7

Related Questions