EMBED THIS RECORDING:
I recorded this `Mashing up code` shellrecording because its a crime to not show people how flexible
Hint: type 'man bash'
# lets mix some php with bash..
print_r($_SERVER); // ok this could be literally everything..xml,json etc
echo "mashing up heads!"
(php -r "$phpcode") | while read line; do
# here I can process every line..
# for example to log output in a nice way
printf "output> %sn" "$line"
Coder of Salvation said
Oh..and some possible scenarios where this comes in handy:
- datamining/crawling websites or feeds
- creating a shellscriptcommand which calls a language-specific function (xpath/json_encode/etc)
- using de/encodingfunctions (base64encode/uuencode) from php
- combine, if you are not sure which language to use
- batch processing of files/images using the best of both (language)worlds