Hi all, i am new in php and i am not getting o/p of this below code, plz help, tell me where i am doing wrong <?php class Person { var $name; function set_name($data) { $this->name; } function get_name() { return $this->name; } } $n= new Person; $n->get_name("vishal"); ?> i am getting neither any warning nor any o/p.. plz someone tell me where i am wrong
Thanks rukbat but even i have tried with below code, but i have not found any result class Person { var $name; function set_name($data) { $this->name; } function get_name() { return $this->name; } } $n= new Person; $n-> set_name("vishal"); echo $n-> get_name(); plz give some suggestions
<?php class person { var $name; function set_name($data) { $this->name=$data; } function get_name() { return $this->name; } } $n= new person; $n->set_name("Vishal"); echo $n->get_name();