arimbun

  • Author: arimbun
  • Published: Jul 25th, 2010
  • Category: Mac
  • Comments: None

Apache/MySQL/PHP config on Snow Leopard

Tags: , , , , ,

By default, Mac OS X 10.6 (Snow Leopard) bundles with Apache/MySQL/PHP. However, they do not quite work out of the box. Follow these extra steps and you’ll get your web server up and running in no time.

PHP: echo and print

Tags: , , ,

Both commands are used to display some output, so what’s the difference? I chanced upon an interesting article that covers the differences between the two. I’ll put up the summary here:

  • echo is (marginally) faster than print. Providing that the statement is in a large enough loop, one will notice a slight performance gain by using echo. It’s probably advisable in the long run, unless you’re already used to print.
  • passing mutiple string parameters is faster than concatenating multiple echo calls. See example below:
  • // "." signals concatenation and is slower
    echo "hello" . "world"
    
    // "," signals multiple arguments and is faster
    echo "hello", "world"

© 2010 arimbun

Powered by Wordpress and Magatheme