This is PHP and the syntax is very similar to C. If you see the link I provided, it wont be very difficult for you to decipher the working logic. sign() is a server side function which is taking $txSkeleton & $privateKeys variables as input and returning the signed data. But, if I could sign using PHP itself, I could avoid this step and directly push the signed Tx. I hope, someone, who knows PHP, chime in and point me to a code that allows me to do so...
Okay - then I hope the OP will explain his misleading point (hopefully it isn't a scam but it could be).
Well... blockcypher is definitely not a scam. blockcypher API is also used by services like ShapeShift.io. blockchain.info needs your private key/password too to send a Tx. This has become the de-facto rule for small bitcoin app devs and most do not bother much about this (well they'll tell you lots of security stories though). I have used blockchain.info before and none of my faucets ever got hacked. The thumb rule is to keep low amount in the hot wallet. But, as I am preparing for a bigger project I was exploring for an API that offers better security.
Actually blockchain.info doesn't use your keys on their side, all signing is done in browser. You never hand over raw keys to blockchain.info thank the stars!