Query: curl_escape
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
CURL_ESCAPE(3) 1 CURL_ESCAPE(3) curl_escape - URL encodes the given stringSYNOPSISstring curl_escape (resource $ch, string $str)DESCRIPTIONThis function URL encodes the given string according to RFC 3986.PARAMETERSo $ch -A cURL handle returned by curl_init(3). o $str - The string to be encoded.RETURN VALUESReturns escaped string or FALSE on failure.EXAMPLESExample #1 curl_escape(3) example <?php // Create a curl handle $ch = curl_init(); // Escape a string used as a GET parameter $location = curl_escape($ch, 'Hofbrauhaus / Munchen'); // Result: Hofbr%C3%A4uhaus%20%2F%20M%C3%BCnchen // Compose an URL with the escaped string $url = "http://example.com/add_location.php?location={$location}"; // Result: http://example.com/add_location.php?location=Hofbr%C3%A4uhaus%20%2F%20M%C3%BCnchen // Send HTTP request and close the handle curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_exec($ch); curl_close($ch); ?>SEE ALSOcurl_unescape(3), urlencode(3), rawurlencode(3), RFC 3986. PHP Documentation Group CURL_ESCAPE(3)
Related Man Pages |
---|
curl_multi_exec(3) - php |
curl_reset(3) - php |
curl_multi_close(3) - php |
curl_share_close(3) - php |
rawurlencode(3) - php |
Similar Topics in the Unix Linux Community |
---|
Php |
Modifying the URL to point to another location in a .sh UNIX file |
how to use in bash variables and quotes |
Using cURL to submit a post form |
Find string in file and append new string after |