php - How will i pass the value to the following format? -


i trying pass value function 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 pass values in format.how give pass value channelids=1,2,3? use http_build_query 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 set value?

you can use urlencode function encode channel ids. function may 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(); 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -