The Situation
I'm currently decoding my array into JSON and display it The structure is like that:
["value1","value2","value3","..."]
I want that data in an API request. So I thought of saving it to a variable and put that in the api request but I always get the error message invalid input format. Since the API request needs the data like this:
API URL: "http://somedomain.com/api?=key:=searchfor=value1>>value2>>value3>>..."
My previous approach was:
"http://somedomain.com/api?=key:=searchfor=$mycustomarray"
I tried it with an array and JSON data but both wont work for the request.
What I want to achieve
I want to get that data displayed in the format I need it for that API request. Is there a way to get the JSON or Array in the desired format: I should be put in the api request like:
[value1>>value2>>value3>>...]
I would appreciate any help
implodeon your array. php.net/manual/en/function.implode.php that isimplode(">>",$yourArray);