Category Archives: php

Array

Indexed Array: $arr = array(“…”, “…”, “…”); / $arr = []; OR $arr[no] = “…”; Append an Item: $arr[] = newValue; To Loop through an indexed array: For Loop: for($x = 0; $x < $arrlength; $x++) { echo $arr[$x]; } Foreach Loop: foreach … Continue reading

Posted in php | Leave a comment

Basic

File: index.php Syntax:  Display: echo ‘… ‘;                                    Print: print_r(…); Comment: //, #, /*…*/ Break: echo ” “; Concatenate: echo $x.$y; / echo ‘string’.$x; / echo “string $x”; Operator Arithmetic: +, -, *, /, %, ** Assignment: =, +=, -=, *=, … Continue reading

Posted in php | Leave a comment