Subscribe to RSS Feed

Archive for the 'Code Snippets' category

Code Snippets: Edit hosts file in Mac OS X 10.5 Leopard

I do a lot of development in Leopard. Typically for most projects there is a sandbox set up to mirror the production server. I’ve found the easiest way and best practice to work on the sandbox is to change the IP to forward to the production domain. What you do is open Terminal, which is [...]

Read the article

Code Snippets: Add comma’s to a string

Pretty commonly I’ll need to display a string of text that needs to be comma delineated using PHP.  This is the easiest way I have found to accomplish this. <?php $string = “test test2 test3 test4 test5 “; echo substr(str_replace(” “, “, “, $string), 0, -2); //outputs test, test2, test3, test4, test5 ?> Make sure [...]

Read the article