Last week, my coworker Marvin IM’ed me this blog post about Ruby and Unicode. I thought it was really interesting how Ruby can handle Unicode this way.
So I set out to test this with PHP just to compare it with Ruby, since after all, PHP is THE language of choice at Yahoo!. :) And you know what? It works for PHP too! Even though Zend Studio IDE, the editor that I’m using to code and debug PHP, is complaining to me that my syntax is wrong, the snippet below works just fine on PHP5+.
Click here to see the raw code that you can copy and paste. Otherwise, I posted a screenshots for people whose browsers can’t read unicode. One caveat, if you do copy and paste this snippet into your favorite IDE, please encode your file with UTF8 to see the sigma symbol correctly.
Yes yes, I know I could’ve written this function much shorter. :) I just wanted to show off another thing that you can do with PHP variables. Basically, it allows me to write my variable’s name in almost any manner…not sure how useful it would be though. You can check this link out for more info about it.
So that’s that for what I have discovered in the wonderful world of PHP last week! If this is old news to you then good for you! ;) It’s new news to me.

