Decoding Google's Tweet With PHP

This is something for fun — nothing serious. It just happened that Google just sent a mysterious Tweet around 2 hours ago from now with an image with of the Google home page featuring an UFO. The UFO was seen pulling an O out of the google logo. But what the heck does that tweet mean ?

1.12.12 25.15.21.18 15 1.18.5 2.5.12.15.14.7 20.15 21.19 was the tweet.

Well, it’s nothing tough. Every number separated by a dot or space corresponds to the alphabet. So, I wrote a PHP script to decode this mysterious tweet and finally found the meaning:

 
masnun@ubuntu:~/Desktop$ php decode-google-tweet
all your o are belong to us
masnun@ubuntu:~/Desktop$

So, it meant ” all your o are belong to us ” ;-)
Sounds a bit odd ? Or wrong in grammar ? yeah, still, that’s the message. It is confirmed on the twitpic image.

And here’s the source code –

 
<?php
 
$num = array(); // placeholder for 1 to 26
$alpha = array(); // placeholder for a to z
 
for($i=1;$i<27;$i++) { $num[]= $i; } // dynamically store 1 to 26 in the array
for($i='a';$i<'z';$i++) { $alpha[]= $i; } // dynamically store a to y in the array
$alpha[] = 'z'; // manually add z to the array
$dict = array_combine($num,$alpha); // combine them to form a dictionary
 
// print_r($dict);
 
$string = "1.12.12 25.15.21.18 15 1.18.5 2.5.12.15.14.7 20.15 21.19"; // the code to decode
$arr = explode(" ",$string); // differentiate the parts
 
$meaning = ""; // placeholder for the ultimate meaning
 
for($i=0; $i<count($arr); $i++) {
 
$s = $arr[$i]; // dot seperated portions
$a = explode(".",$s); // seperate the numbers
for($j=0; $j<count($a); $j++) {
$ch = $a[$j]; // get individual numbers
$meaning .= $dict[$ch]; // look up in the dictionary for the corresponding char
 }
$meaning .=" "; // restore the spaces
 
 
}
 
echo $meaning."\n"; // echo the meaning
 
?>

It was quite a bit of fun decoding the message with PHP. Well, I do agree that there was no need to use PHP here. But why do the hard work from memory when you have automation tools at your hand ;-) ?

Tags: , , , . Bookmark the permalink.

2 Responses to Decoding Google's Tweet With PHP

  1. Pingback: google ufo logo – ???

  2. Clemento says:

    ?????????????! ???????? ? ????????? ?? ?????? ? ?? ?????.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">