Category Archives: Php Snippets

Php code snippets and examples

Fill text templates using arrays in php

By | September 22, 2012

Text templates are often used to generate content like notification emails, invoices filled with the details of a customer or user. The best example would be a bulk email program that sends out emails to multiple users filling the details of the particular user in every individual mail. Text templates have place holders for fields… Read More »

Execute shell commands in PHP

By | March 27, 2012

Like any other language php applications often need to execute system commands like they are run from the terminal/console/commandline. Php has multiple functions to do this task. Lets take a look at each of these 1. system “system() is just like the C version of the function in that it executes the given command and… Read More »