wissem_benali
New Member
\[code\]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=http://stackoverflow.com/questions/1985576//"$this->url\"/>"; } } $n = new MyImageTestClass(); $n->loadImg("peterson.jpg","two"); \[/code\]Or should I keep the setID() and setURL out of the loadImg function and then write,\[code\]$n->setID(); $n->setUrl(); $n->loadImg(); \[/code\]