JavaScript and PHP code for URL builder for Facebook Share link and Twitter Tweet link
Please feel free to remix, re-use, and modify as you wish.
============= AUTHOR
David Rust-Smith www.davidrs.com
============= DESCRIPTION
If you’re trying to make a share button (also called a ‘Feed Dialog’), there’s a long complicated way with JavaScript, great for finer control, but if you want something quick and simple you can just build a normal, one-line, link. This code helps to build one for you. There is a JavaScript version of the code, and a PHP equivalent.
There is minimal error checking and input validation.
========== DISCLAIMER
Use at your own risk, no guarantees about reliability, performance, or possible un-intended side-effects.
=============