I created two files,the result is 'doc1, which defined in initial var
but I called setType('strict'), my expectation should be 'doc2'
what happened?
my_type.php
<?php
class my_Type{
var $standard ='doc1';
function my_Type(){
$this->getType();
}
function getType(){
return $this -> $standard;
}
function setType($type_style){
switch (strtolower((string)$type_style)) {
case 'transitional':
$standard = 'doc1';
break;
case 'strict':
$standard = 'doc2';
break;
case 'frameset':
$standard = 'doc3';
break;
default:
$standard = '';
break;
}
}
}
?>
-------------------------------------------
index.php
<?php
require('my_type.php');
$web_type = new my_Type();
$web_type -> setType('strict');
echo $web_type -> getType();
?>