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.
- Author: arimbun
- Published: Jul 20th, 2010
- Category: Programming
- Comments: None
PHP: echo and print
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:
echois (marginally) faster thanprint. Providing that the statement is in a large enough loop, one will notice a slight performance gain by usingecho. It’s probably advisable in the long run, unless you’re already used toprint.- passing mutiple string parameters is faster than concatenating multiple
echocalls. See example below:
// "." signals concatenation and is slower echo "hello" . "world" // "," signals multiple arguments and is faster echo "hello", "world"
Recent Comments