Skip to content

Instantly share code, notes, and snippets.

@border
Created November 1, 2013 09:05
Show Gist options
  • Save border/7262783 to your computer and use it in GitHub Desktop.
Save border/7262783 to your computer and use it in GitHub Desktop.
Shell for urlencode
#!/bin/bash
if [ -z "$1" ]
then
echo "usage: ./urlencode.sh 'hello'"
exit 0
fi
echo -n $( php -r "echo rawurlencode(\"$1\");"; )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment