News Feed
Jobs Feed
Sections




News Archive
Adam Trachtenberg's Blog:
Stupid PHP one liners Google calc
August 24, 2006 @ 07:22:10

One-liners can sometimes be quite helpful in your programming, and in hopes it will help someone out there out, Adam Trachtenberg shares one of his own in his latest blog entry today.

A long time ago, I wrote a two line hack that let you use Google as a command line calculator. It eventually ended up in the 2nd and 3rd editions of Google Hacks.

The code calls the Google Calculator page and pulls back in the contents, allowing you to pass in any sort of calulation you might want and pass back out the result all cleaned up and parsed out.

0 comments voice your opinion now!
oneline google calculator commandline file_get_contents regular expression oneline google calculator commandline file_get_contents regular expression


blog comments powered by Disqus

Similar Posts

Maarten Balliauw's Blog: A hidden gem in the Windows Azure SDK for PHP: command line parsing

phpRiot.com: Shortening URLs for goo.gl with Google's URL Shortener API

Adam Trachtenberg's Blog: Stupid PHP one liners: Google calc

PHPMaster.com: Maintaining your Server with Command Line PHP

Johan Mares' Blog: Running PHP CLI shell scripts


Community Events











Don't see your event here?
Let us know!


framework language conference community release example development opinion code tool podcast zendframework2 database interview series composer testing object functional introduction

All content copyright, 2013 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework