📜  如何在 url 中获取 ID 和其他字符串 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:02.090000             🧑  作者: Mango

代码示例1
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);