1

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.

1 Answer 1

7

You can use implode():

implode(' or ', $array['emailVal'])
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.