Answers for "How to get ID and other string in url"

PHP
0

How to get ID and other string in url

urlencode is useful when using certain URL shortener services.

The returned URL from the shortener may be truncated if not encoded. Ensure the URL is encoded before passing it to a shortener.

Example

$url = "https://www.notarealurl.com?id=50&name=namestring";
$encodedurl = urlencode($url);
$shorturl = UrlShortener::shortenUrl( $encodedurl);
Posted by: Guest on October-26-2021

Code answers related to "How to get ID and other string in url"

Browse Popular Code Answers by Language