Skip to content

Instantly share code, notes, and snippets.

@volandku
Last active December 8, 2019 15:08
Show Gist options
  • Save volandku/8000c7deb654df93ebd181e40b52be97 to your computer and use it in GitHub Desktop.
Save volandku/8000c7deb654df93ebd181e40b52be97 to your computer and use it in GitHub Desktop.
urlencode full url given at input
function urlencodeFull($string)
{
$ar=explode('://',$string);
foreach ($ar as $key=>$item)
{
$last=explode("/",$item);
foreach ($last as $subkey=>$subitem)
{
$last[$subkey]=rawurlencode($subitem);
}
$ar[$key]=implode("/",$last);
}
return implode("://",$ar);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment