Skip to content

Instantly share code, notes, and snippets.

@gwainor
Created September 8, 2012 23:28
Show Gist options
  • Save gwainor/3681020 to your computer and use it in GitHub Desktop.
Save gwainor/3681020 to your computer and use it in GitHub Desktop.
PHP Cheat Sheet

PHP Cheat Sheet

The purpose of this project is creating all usable ways of PHP coding.

This gist will contain:

  • Variables
  • Control Structures
  • Loops
  • Classes
  • [More to come]
<?php
/**
* PHP Cheat Sheet
*
* Purpose: Creating a cheat sheet for PHP
*/
/**
* Standart variable creation
*/
$a = 1;
$_b = "some text";
$c = array(
'a' => 1,
'b' => "Some text",
4,
6
);
$d = true;
$e = 1.23;
/**
* Defining same value to multiple variables
*/
$a = $b = $c = 1;
/**
* Defining a variable's value as variable
*/
$a = "b";
$$a = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment