I'm trying to create a function to turn a link into a link to 'add link to Pocket' via getpocket.com/save.
I don't want to use the API and have users have to start logging in to their Pocket account - the /save link works if they're already logged in on the current browser.
I have:
function save_pocket($url){
$enc = rawurlencode($url);
$pocket = "http://getpocket.com/save/?url=";
return $pocket.$enc;
}
save_pocket()
is then called in <a href="
.
But this returns either $url
or $enc
, I can't tell which. But the issue is it's not adding $pocket
prefix.
Why?