Following are my notations / findings through PHP development at a glance:

_____________________________________________________

Covering the base

  • PHP Editor IDE:  Eclipse for PHP Developers, 140 MB
  • ; (Semi-colon) signifies the end of PHP statement.  Mandatory
  • Avoid use HTML <script> tag and ASP-style delimiter; may cause onfusion with JS; use <?PHP ?> or <? ?>
  • \ is used to escape “, variable as text
  • . is used for concatenation; . inside quotation marks  is interpreted as a period.     use . to concat variables not array or object.
  • superglobal arrays $GLOBAL, $_SERVER, $_GET, $_POST, $_REQUEST, $_FILES, $_SESSION, $_COOKIE; variable scope

Mechanics:

  • array index by number key –   $someArray[indexnumber];
  • multidimension array – $someArray[indexnumber][somekey] of $someArray[indexnumber][indexnumber]
  • multidimensional array with multi string liternal – $someArray = array(‘somekey’ => array(‘some value’, ‘some value’), ‘somekey2′ => array(‘some value2′, ‘some value2′))
  • use list() –  list($somevariable, $somevariable2..) = somefunction return the variables
  • printf() — think of this as “print with format”; printf(‘%s’, somevalue of some string); %s (string), %d(integer), %g(float), %.2 (two digit after decimal)
  • sprintf() —  returns a string;
  • print_r() — return readable info about a variable; print_r($someArray);

____________________________________________________________________________________________