class phpParser{
public $pageString;
//some other properties and methods
class software{
private $baseName;
private $url;
private $html;
public initiateValues (){
$this->html = new phpParser ();
}
}
// Now how to access properties and methods of phpParser class through software class member $html (which is actually object // of phpParser class). I think i should be something like this
$mySoftware = new software();
$mySoftware->html->pageString; //this not work how i access please help me please urgently i am pending my work untill you //guys answer me
ousaf
-3
Newbie Poster
Recommended Answers
Jump to PostIt doesn't work because your html property is
private
. Change it topublic
.
Jump to Postyou could write a 'get' method
Or use
__get
, read here
All 5 Replies
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
diafol
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
diafol
veedeoo
474
Junior Poster
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.