Skip to content

Instantly share code, notes, and snippets.

<?php
function writeMsg()
{
echo "Hello world! <br/>";
}
writeMsg(); // call the function
<?php
// Create new DateTime objects and format them
// Specified date/time in your server's time zone.
$date = date_create('2001-01-01');
echo $date->format('Y-m-d H:i:s P') . "<br/><br/>";
// Specified date/time in the specified time zone.
<?php
// 80/20 PHP - Day Six - Strings
// http://api-demo.com/scripts/strings.php
// Using Single Quotes
<?php
// 80/20 PHP - Day Five
// http://api-demo.com/scripts/loops.php
/*
*
* The FOR loop is used when you know how many times you want to
* execute a statement or a block of statements.
<?php
// 80/20 PHP - Day Three
// http://api-demo.com/scripts/arrays.php
/* Example from the handout
$myFarm =array(
<?php
/*
* Note: This script is subject to all the disclaimers of 80/20 programming. Offered as-is
* without warranty as to completeness or suitability
* Most of us do not intend to become programmers. We just want to get simple things done quickly
* and cost effectively.
* It has to be secure but it doesn't have to be perfect
* We may, at times, use deprecated code if it makes it easier/faster to read/learn
* We may, at times, not have the most efficient code possible if it makes it easier/faster to read/learn
<?php
/*
* Does anyone have a suggestion for this:
* I need all new contacts entered into IS--whether by web form, order form, manual or
* import to have their email * address set as their username, too.
* I'd like to set that action as an action set that so that i can run it under
* all ACTIONS and also give it to the admins to perform on imports.
* I need help in creating that action, right now all I can do is set the username
* to a specific value but can't see* where i can make that value be the email merge field. Any help?
<?php
// Nested If statements
If($breed == 'dog' ) {
echo 'This is a canine';
} else {
If($breed == 'horse') {
echo 'This is an equine';
} else {
<?php
// Simple IF statements
If($contactId == 1234) {
$tagId = 26;
}
If($contactId !== 1234) { // ! means Not
<?php
// Encourage you to add your own comments as we go
/*
This is how you
add multi-line comments
*/
$contactId = $_REQUEST['id'];