I am trying to pass the value to a function to get the following url:
search?channelIds=1,2,3&streamName=wew&page=0&size=10
code inside function:
$this->request->set("url","broadcasts/pubic/search");
$this->request->set_fields(array(
'channelIds'=>$channel_ids,
'streamName'=>$stream_name,
'page'=>$page,
'size'=>$size
));
$result = $this->request->send();
Here i pass the values in this format.How will give pass value for channelIds=1,2,3? i use http_build_query for url formation. $channel_ids=array("channelIds"=>1, "channelIds"=>2, "channelIds"=>3); $stream_name="wew"; $page=0; $size=10; $getlivebroadcast = $api-searchBroadcast($channel_ids,$stream_name,$page,$size);
How will i set the value?
You can use the urlencode function to encode the channel ids. Your function may look like:
$this->request->set("url","broadcasts/pubic/search");
$this->request->set_fields(array(
'channelIds'=>urlencode($channel_ids),
'streamName'=>$stream_name,
'page'=>$page,
'size'=>$size
));
$result = $this->request->send();