curl_escape(3) php man page | unix.com

Man Page: curl_escape

Operating Environment: php

Section: 3

CURL_ESCAPE(3)								 1							    CURL_ESCAPE(3)

curl_escape - URL encodes the given string

SYNOPSIS
string curl_escape (resource $ch, string $str)
DESCRIPTION
This function URL encodes the given string according to RFC 3986.
PARAMETERS
o $ch -A cURL handle returned by curl_init(3). o $str - The string to be encoded.
RETURN VALUES
Returns escaped string or FALSE on failure.
EXAMPLES
Example #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 ALSO
curl_unescape(3), urlencode(3), rawurlencode(3), RFC 3986. PHP Documentation Group CURL_ESCAPE(3)
Related Man Pages
curl_easy_escape(3) - suse
curl_setopt_array(3) - php
curl_share_setopt(3) - php
curl_multi_add_handle(3) - php
curl_unescape(3) - php
Similar Topics in the Unix Linux Community
Php
how to use in bash variables and quotes
curl doesn't work in browser
Php posting help
Find string in file and append new string after