HTML and CSS Reference
In-Depth Information
You'll see the following output:
computer parts
Arrays are important in PHP because database data are ot en loaded into an array for output.
Objects and properties
Objects in PHP are based on user classes — there's no Object() object like there is in
JavaScript. Making a class is like creating an object with all the variables, arrays, constants,
and functions you like in one place. Here are the basics of creating a class, adding properties,
and adding methods in this example ( PropMethod.php in this chapter's folder at www. ):
class PropMethod
private $propString = ”I work well with HTML5” ;
private $propNum = 2044 ;
private $propBool =true;
public function showString ()
echo $this -> propString , “<br>” ;
public function showNum ()
echo $this -> propNum , “<br>” ;
public function showBool ()
echo $this -> propBool ;
$testPM = new PropMethod ();
echo $testPM -> showString ();
echo $testPM -> showNum ();
echo $testPM -> showBool ();
h e output for that little class is:
I work well with HTML5
Search WWH ::

Custom Search