diff --git a/application/libraries/tweet.php b/application/libraries/tweet.php index 20504da..6188ec0 100755 --- a/application/libraries/tweet.php +++ b/application/libraries/tweet.php @@ -96,14 +96,7 @@ public function get($url, $params) { if ( count($params['request']) > 0 ) { - $url .= '?'; - - foreach( $params['request'] as $k => $v ) - { - $url .= "{$k}={$v}&"; - } - - $url = substr($url, 0, -1); + $url = http_build_query($params); } $this->_initConnection($url); @@ -114,15 +107,7 @@ public function get($url, $params) public function post($url, $params) { - // Todo - $post = ''; - - foreach ( $params['request'] as $k => $v ) - { - $post .= "{$k}={$v}&"; - } - - $post = substr($post, 0, -1); + $post = http_build_query($params); $this->_initConnection($url, $params); curl_setopt($this->_ch, CURLOPT_POST, 1);