8 useful PHP code snippets for developers

Today, i want to share you some useful PHP code snippets which may reduce your development time.

1.Send HTML Mail

$to = "[email protected]";
$subject = "This is my test html email send using php mail function";
$body    = "Body of your message here you can use HTML too. <br /> <h1> Header </h1> ;";
$headers = "From: User \r\n";
$headers.= "Reply-To: [email protected]\r\n";
$headers.= "Return-Path: [email protected]\r\n";
$headers.= <"X-Mailer: PHP5\n";
$headers.= 'MIME-Version: 1.0'."\n";
$headers.= 'Content-type: text/html; charset=iso-8859-1'."\r\n";

Read more