← All built-ins / urlencode()
urlencode()
urlencode(string $s): string
Parameters
| Name | Type | Description |
|---|---|---|
| $s | string | text for a query string |
Return value
Encoded text: space becomes +, reserved characters become %XX.
Example
echo urlencode("holy php & more");holy+php+%26+more