Page 341 - CITS - CSA - TP (Volume 1) - Hindi
P. 341

कंप्यूटर सॉफ्टवेयर एप्लीकेशन- CITS



                                        $this->name = $name;

                                        $this->age = $age;
                                        echo “Constructor called\n”;

                         }
                         // Method to display information

                         public function displayInfo()
                         {

                                        echo “Name: “ . $this->name . “, Age: “ . $this->age . “\n”;

                         }
                  }

                  // Creating an object of MyClass
                  $obj = new MyClass(“John”, 30);

                  // Calling method to display information
                  $obj->displayInfo();

                         ?>
              </body>

              </html>
           3   ो ाम को C:\Apache24\htdocs म  .php ए ट शन वाले फ़ो र म  सेव कर

           4  Apache सिव स को िवंडोज़ सिव स से रन कर

           5   ाउज़र ओपन कर  और िन  एड ेस टाइप कर
              http://localhost/foldername/
           6  रन करने के  िलए php फ़ाइल पर   क कर  और आउटपुट को वेरीफाई कर ।
















           टा  3: ऑ े  िड   र
           1  टे  एिडटर ओपन कर

           2  िन िल खत कोड िलख

                          <html >
                 <head>
                      <title> destructors</title>

                 </head>


                                                           325

                                    CITS : IT & ITES - कं  ूटर सॉ वेयर ए ीके शन - अ ास 59
   336   337   338   339   340   341   342   343   344   345   346