Skip to content

Instantly share code, notes, and snippets.

@whiolf
Created February 2, 2016 11:19
Show Gist options
  • Select an option

  • Save whiolf/bbeb14481358d94ce810 to your computer and use it in GitHub Desktop.

Select an option

Save whiolf/bbeb14481358d94ce810 to your computer and use it in GitHub Desktop.
Just a quick shell script to unserialize php. If you don't send the string as an argument, it tries OS X clipboard.
#!/usr/bin/env bash
if [[ $1 ]];
then
php -r " echo var_dump(unserialize('"$1"')); echo \"\\n\";"
else
STRING=`pbpaste`
php -r " echo var_dump(unserialize('"$STRING"')); echo \"\\n\";"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment