本文整理汇总了PHP中build_query_string函数的典型用法代码示例。如果您正苦于以下问题:PHP build_query_string函数的具体用法?PHP build_query_string怎么用?PHP build_query_string使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了build_query_string函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateSubscription
/**
* Update email subscription status for an email address.
*
* @param int $portal_id
* @param string $email
* @param array $params
* @return \SevenShores\Hubspot\Http\Response
*/
function updateSubscription($portal_id, $email, $params = [])
{
$endpoint = "https://api.hubapi.com/email/public/v1/subscriptions/{$email}";
$queryString = build_query_string(['portalId' => $portal_id]);
$options['json'] = $params;
return $this->client->request('put', $endpoint, $options, $queryString);
}
示例2: build_iframe_url
function build_iframe_url($payer_name, $payee_id, $secret_key, $parameters = null)
{
//$baseURL = "https://ui.tipalti.com"; //production
$baseURL = "https://ui.sandbox.tipalti.com";
//sandbox
return $baseURL . "/Payees/PayeeDashboard.aspx?" . build_query_string($payer_name, $payee_id, $secret_key, $parameters);
}
示例3: search
/**
* Search blog authors.
*
* @param string $q Search query
* @param array $params Optional parameters.
* @return \SevenShores\Hubspot\Http\Response
*/
function search($q = '', $params = [])
{
$endpoint = 'https://api.hubapi.com/blogs/v3/blog-authors/search';
$params['q'] = $q;
$queryString = build_query_string($params);
return $this->client->request('get', $endpoint, [], $queryString);
}
示例4: add_link
private function add_link($label, $params, $class= '') {
$split_path = split('/', $this->base_path);
foreach($split_path as &$path_item) {
$path_item = str_replace('+', '%20', urlencode($path_item));
}
$path = join($split_path, '/');
$this->links[] = array('label' => $label, 'href' => $path . build_query_string($params), 'class' => $class);
}
示例5: trigger
/**
* Trigger a custom event.
*
* This only works for enterprise accounts.
*
* @param string $hubId Your HubSpot portal ID ("Hub ID"). You can find your Hub ID in the
* footer of the HubSpot UI, or in the URL. For example, in this URL:
* "https://app.hubspot.com/reports/56043/events/" your Hub ID is "56043".
* @param string $eventId
* @param string $contactEmail Optional - contact email.
* @param float $contactRevenue Optional - the monetary value this event means to you.
* @param array $contactProperties Optional - array of new contact properties.
* @return \SevenShores\Hubspot\Http\Response
*/
function trigger($hubId, $eventId, $contactEmail = null, $contactRevenue = null, $contactProperties = [])
{
$endpoint = sprintf("http://track.hubspot.com/v1/event?_a=%s&_n=%s", url_encode($hubId), url_encode($eventId));
$contactProperties['email'] = $contactEmail;
$contactProperties['_m'] = $contactRevenue;
$query_string = build_query_string($contactProperties);
return $this->client->request('get', $endpoint, [], $query_string);
}
示例6: call
public function call($path, $get_params = null, $post_params = null)
{
$curl = curl_init();
// maybe move this to the constructor?
if (!$curl) {
Logger::error("Can't initialize curl", array('curlservice', 'service'));
throw new CurlWebServiceException("Can't initialize curl");
}
$this->url = $this->base_url . '/' . $path;
if ($get_params) {
$this->url = $this->url . build_query_string($get_params);
}
$curl_options = array(CURLOPT_URL => $this->url, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HEADER => 0, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_USERAGENT => $GLOBALS['temovico']['service']['user_agent']);
if ($post_params) {
$curl_options[CURLOPT_POST] = 1;
$curl_options[CURLOPT_POSTFIELDS] = $post_params;
}
if ($this->headers && is_array($this->headers)) {
$curl_options[CURLOPT_HTTPHEADER] = $this->headers;
}
curl_setopt_array($curl, $curl_options);
// We have to set these here instead of the by passing them with the $curl_options array or else they're ignored...weird
curl_setopt($curl, CURLOPT_TIMEOUT_MS, $this->timeout);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT_MS, $this->timeout);
$this->requesting(array('service' => 'CurlWebService', 'url' => $this->url, 'POST' => $post_params));
$this->result = curl_exec($curl);
$this->curl_info = curl_getinfo($curl);
$this->curl_errno = curl_errno($curl);
$this->curl_error = curl_error($curl);
// Deal with errors
// For a list of curl error codes, see http://curl.haxx.se/libcurl/c/libcurl-errors.html
if ($this->curl_errno > 0) {
$result_info = array('HTTP Code' => $this->http_code(), 'curl errno' => $this->curl_errno, 'curl error' => $this->curl_error);
switch ($this->curl_errno) {
// TODO: add handling for more errors
case 28:
// It's a timeout
$result_info['message'] = "Curl timed out on {$this->url} with \$connect_timeout = {$this->connect_timeout}ms, \$timeout = {$this->timeout}ms";
$this->received($result_info);
throw new CurlWebServiceException($message, $this->url, $this->curl_errno, $this->curl_error);
default:
// Catchall for other errors
$message = "Curl error on {$this->url}: ({$this->curl_errno}) {$this->curl_error}";
$result_info['message'] = $message;
$this->received($result_info);
throw new CurlWebServiceException($message, $this->url, $this->curl_errno, $this->curl_error);
}
} else {
$this->received(array('HTTP Code' => $this->http_code(), 'result' => $this->result));
}
curl_close($curl);
return $this->result;
}
示例7: is_array
<?if(isset($ads) && is_array($ads) && count($ads)>0):?>
<?foreach($ads as $row):?>
<?$qry = build_query_string(array('id'=>$row['id']))?>
<div class="ad-panel">
<a class='picture' title="<?php
echo $row['title'];
?>
" href="ad.php?<?php
echo $qry;
?>
" name="<?php
echo $row['id'];
?>
">
<img alt="<?php
echo $row['title'];
?>
" src="<?php
echo $row['thumb'];
?>
" />
</a>
<div class="details">
<h3 class='subject'><a href="ad.php?<?php
echo $qry;
?>
"><?php
echo $row['title'];
示例8: all
/**
* @param array $params
* @return \SevenShores\Hubspot\Http\Response
*/
function all($params = [])
{
$endpoint = 'https://api.hubapi.com/owners/v2/owners';
$queryString = build_query_string($params);
return $this->client->request('get', $endpoint, [], $queryString);
}
示例9: foreach
<?php
if ($tct < 1) {
print "<tr><td colspan='4'>No records.</td></tr>";
}
foreach ($expiries as $row) {
?>
<tr>
<?php
print "<td>" . $row['id'] . "</td>";
print "<td>" . $row['name'] . "</td>";
print "<td>" . $row['period'] . "</td>";
?>
<td>
<a href=<?php
print 'expiry-edit.php?' . build_query_string(array('id' => $row['id']));
?>
>Edit</a>
<a href=<?php
print "'" . $_SERVER['SCRIPT_NAME'] . "?d=" . $row['id'] . "&t=" . time() . "#table'";
?>
onclick="return confirm ('Are you sure to delete?')">Delete</a>
<a href=<?php
print "'" . $_SERVER['SCRIPT_NAME'] . "?o=" . $row['id'] . "&r=0&t=" . time() . "#table'";
?>
>Up</a>
<a href=<?php
print "'" . $_SERVER['SCRIPT_NAME'] . "?o=" . $row['id'] . "&r=1&t=" . time() . "#table'";
?>
>Down</a>
</td>
示例10: uri
<a id="filter-readonly" class="glyphicon glyphicon-<?php
echo $unread ? 'check' : 'unchecked';
?>
" href="<?php
echo uri('articles') . build_query_string(array('category' => $category, 'unread' => $unread ? 0 : 1));
?>
">只显示未读</a>
</div>
<div>
<ul id="category" class="dropdown-content">
<li><a href="<?php
echo uri('articles') . build_query_string(array('category' => null, 'unread' => $unread));
?>
">所有</a></li>
<?php
foreach (UserWechatCategory::findAll() as $category) {
?>
<li><a href="<?php
echo uri('articles') . build_query_string(array('category' => $category->getId(), 'unread' => $unread));
?>
"><?php
echo $category->getName();
?>
</a></li>
<?php
}
?>
</ul>
</div>
</div>
</div>
示例11: build_nested_batch_with_encoding_RFC1738
/** @test */
public function build_nested_batch_with_encoding_RFC1738()
{
$query = ['email' => 'test@test.com', 'description' => 'two words', 'property' => ['firstname', 'lastname']];
$queryString = build_query_string($query, PHP_QUERY_RFC1738);
$this->assertEquals('&email=test%40test.com&description=two+words&property=firstname&property=lastname', $queryString);
}
示例12: all
/**
* Get all blog posts.
*
* @param array $params Optional parameters.
* @return \SevenShores\Hubspot\Http\Response
*/
function all($params = [])
{
$endpoint = "https://api.hubapi.com/content/api/v2/blog-posts";
$queryString = build_query_string($params);
return $this->client->request('get', $endpoint, [], $queryString);
}
示例13: recentContacts
/**
* Get recently added contact from a list.
*
* @param int $id List id
* @param array $params
* @return \SevenShores\Hubspot\Http\Response
*/
function recentContacts($id, $params = [])
{
$endpoint = "https://api.hubapi.com/contacts/v1/lists/{$id}/contacts/recent";
$queryString = build_query_string($params);
return $this->client->request('get', $endpoint, [], $queryString);
}
示例14: all
/**
* Get email events for a campaign or recipient.
*
* @param array $params Optional parameters
* @return \SevenShores\Hubspot\Http\Response
*/
function all($params = [])
{
$endpoint = "https://api.hubapi.com/email/public/v1/events";
$queryString = build_query_string($params);
return $this->client->request('get', $endpoint, [], $queryString);
}
示例15: getGroups
/**
* Get contact property groups.
*
* Returns all of the contact property groups for a given portal.
*
* @see http://developers.hubspot.com/docs/methods/contacts/v2/get_contact_property_groups
*
* @param bool $includeProperties
* @return \SevenShores\Hubspot\Http\Response
*/
function getGroups($includeProperties = false)
{
$endpoint = "https://api.hubapi.com/contacts/v2/groups";
$queryString = build_query_string(['includeProperties' => $includeProperties]);
return $this->client->request('get', $endpoint, [], $queryString);
}