2
{ "PHP" : { "2017/03/10-2017/03/11. Sharon Xiao Liu. Short PHP notes in JSON format.": "Superseded. A new technique builds on the foundation of this principle, however. To remember something, process it or add to it in some way.", "Notes": "Learn when the entire pyramid structure is complete, using a tree viewer for JSON. https://www.w3schools.com/php/php_string.asp .", "Meaning": "PHP: Hypertext Preprocessor.", "Global variables": { "global $one_variable, $another_variable;": "Makes a global variable accessible within a local scope.", "$_GLOBALS['variable_name']": "Access a global variable within a function." }, "Static variables": { "static $variable = 0;": "A static variable is one which is remembered for the next call of the same function." }, "Displaying variables": { "echo $variable;": "", "print $variable;": "", "var_dump($variable);": "Tells you the data type of the variable, and what it contains." }, "Variable types": { "Text": { "Long": { "$variable = \"value\";": "String.", "$variable = array(\"one value\", \"another value\");": "Array." }, "Short": { "$variable = true;": "Boolean.", "$variable = null;": "Null." } }, "Number": { "$variable = 100;": "Integer.", "$variable = 100.1": "Float." }, "Special": { "$object = new class_name();": "Object.", "$resource = mysql_connect('localhost', 'mysql_user', 'mysql_password');": "PHP Resource" } }, "Objects": { "class class_name {}": "Defines a class.", "$this->property_name = \"property_value\"": "Sets a property within a class.", "echo $object->property_name;": "Accesses a property within an object." }, "Forms": { "$_POST[\"variable_name\"]": "" }, "Sessions": { "session_start();": "After this, you can set session variables.", "$_SESSION[\"variable_name\"]": "" }, "Cookies": { "setcookie($cookie_name, $cookie_value, time() + (86400 * 30),

20170310 PHP goal pyramid for memorising

Embed Size (px)

Citation preview

Page 1: 20170310 PHP goal pyramid for memorising

{"PHP" : {

"2017/03/10-2017/03/11. Sharon Xiao Liu. Short PHP notes in JSON format.": "Superseded. A new technique builds on the foundation of this principle, however. To remember something, process it or add to it in some way.",

"Notes": "Learn when the entire pyramid structure is complete, using a tree viewer for JSON. https://www.w3schools.com/php/php_string.asp .",

"Meaning": "PHP: Hypertext Preprocessor.","Global variables": {

"global $one_variable, $another_variable;": "Makes a global variable accessible within a local scope.",

"$_GLOBALS['variable_name']": "Access a global variable within a function."

},"Static variables": {

"static $variable = 0;": "A static variable is one which is remembered for the next call of the same function."

},"Displaying variables": {

"echo $variable;": "","print $variable;": "","var_dump($variable);": "Tells you the data type of the

variable, and what it contains."},"Variable types": {

"Text": {"Long": {

"$variable = \"value\";": "String.","$variable = array(\"one value\", \"another

value\");": "Array."},"Short": {"$variable = true;": "Boolean.","$variable = null;": "Null."}

},"Number": {

"$variable = 100;": "Integer.","$variable = 100.1": "Float."

},"Special": {

"$object = new class_name();": "Object.","$resource = mysql_connect('localhost', 'mysql_user',

'mysql_password');": "PHP Resource"}

},"Objects": {

"class class_name {}": "Defines a class.","$this->property_name = \"property_value\"": "Sets a property

within a class.","echo $object->property_name;": "Accesses a property within an

object."},"Forms": {

"$_POST[\"variable_name\"]": ""},"Sessions": {

"session_start();": "After this, you can set session variables.",

"$_SESSION[\"variable_name\"]": ""},"Cookies": {

"setcookie($cookie_name, $cookie_value, time() + (86400 * 30),

Page 2: 20170310 PHP goal pyramid for memorising

\"/\");": "Sets a cookie for 30 days and to be available for the entire website, including the top level directory.",

"$_COOKIE[\"cookie_name\"]": "","setcookie($cookie_name_to_delete, \"\", time() - 3600)": "To

delete a cookie, set the expiration date to be in the past."}

}}