Skip to content

Instantly share code, notes, and snippets.

View post72's full-sized avatar

Bill Burch post72

View GitHub Profile
@post72
post72 / php-if-else
Created April 29, 2015 20:08
A simple PHP If / Else conditional
<?php
// Giving the variable Test a value of Hello World
$test = "Hello World";
// Begin If-Else conditional //
// If the Test variable exists and it has a value of Hello World...
if (isset($test) && $test == "Hello World") {
ob_start(); ?>
@post72
post72 / spanish-date
Created February 10, 2015 21:51
Translating the month into Spanish for date - time
<?php
// Sets the localtion to Spanish
setlocale(LC_ALL, 'Spanish');
$year = date("Y"); // Sets the current year
$day = date("j"); // Sets the curent day
// Returns the Spanish month - along with the day and year
echo strftime("%B")." ".$day.", ".$year; ?>