class MyImageTestClass{
var $url = "nfl2.jpg";
var $ID = "one";
function __construct() {
}
function setUrl($value){
$this->url = $value;
}
function setID($newid){
$this->ID = $newid ;
}
function loadImg($value,$newid){
$this->setID($newid);
$this->setUrl($value);
print "<img id=\"$this->ID\" src=\"$this->url\"/>";
}
}
$n = new MyImageTestClass();
$n->loadImg("peterson.jpg","two");
Or should I keep the setID() and setURL out of the loadImg function and then write,
$n->setID();
$n->setUrl();
$n->loadImg();