Categories
PHP Python

Calling a function using string

PHP:
In php, you can assign a function name as a string to a variable and call the function by adding “()” after the variable name and appending a semicolon. Like this:

Python:
In python we call the function using the str as a key to the dictionary recieved by calling the globals() function. Like this:

Cool, eh?

Categories
PHP Python

Why PHP is going to be language of the future!

PHP is now the 3rd most popular programming language. And I believe, PHP is going to be the language of the future. I won’t go talking about the strength, flexibility or any other characteristics of programming languages, rather, I would like to highlight why PHP is going to be the most popular and most used language very soon:

# PHP is mainly a web automation tool. Web applications are most portable and cross-platform in nature. The web applications developed in PHP is expected to run on hundreds of thousands of machines without any further modification or system extension. The app I developed on my Linux machine runs smoothly on my Windows as well. Web applications can be accessed by anyone from anywhere. The age of client side applications is going to be over very soon. Undoubtedly PHP has the widest coverage in the web application arena.

# You can easily build mobile web applications using PHP which will run on all mobile devices which have internet connectivity. You don’t really need to learn J2ME to serve your mobile users.

# With jQuery and all those fantastic UI tools, web apps can have cool GUI like desktop apps as well.

# The things I mentioned above could be achieved by some other languages too. But again, almost all web hosting providers have PHP support where as you have to look for Python or Ruby support, let alone Java or Tomcat. So, PHP has a huge advancement in this case.

# People find PHP easy to learn. I am quite surprised how fast beginners learn PHP today. I don’t know why but it’s a clear indication that the popularity of PHP is on the rise for sure.

# PHP has a huge community. You get help and support from them very quickly. Again PHP having a large community and numerous mailing lists, forums etc, you even have the option to switch between them 😀

# Have you ever wondered how many free shared hosting providers support PHP ? Ask google 😀

# PHP has so many tutorials, HOWTOs and docs spread over the internet. I doubt if any other language has as much free resources as PHP have today.

# PHP programs being open source, you always have the chance to modify a program by yourself.

# PHP-GTK and some other tools are being developed for building desktop tools as well. I do believe these tools would do good in the future.

# I always found the PHP Manual more user friendly and very informative. There are examples in almost everywhere. That makes learning and using PHP easy and comfortable.

# PHP has a very large collection of extensions developed by the PHP dev community.

I don’t really doubt that PHP is going to be the language of the future. If they call PHP a “bad” language, I am afraid, the future is going to be “bad” 😉

Categories
PHP

PHP Text Flipper Library

Have you seen some cool webapps where you can write English texts upside down?

I have found out the techniques. They just use some Unicode characters to do the trick. Unicode has a vast collection of characters and you have to find the right one that looks like an upside down english character.

I have written a PHP library to do the job .
Visit the demo at:
https://masnun.com/flipper/ 😀
Download the Library at:
http://masnun.googlecode.com/files/flipper.php 🙂

Here’s the source code of the demo:

PS: PHP and web browsers have some issues regarding Unicode data. So please ensure the “Content-type” is set to “text/html” and the charset is “utf-8” 🙂

Happy flipping 😀