⊗ppOpFnGCN 52 of 107 menu

Function for Getting the Class Name in OOP in PHP

get_class

Create an object of some class. Apply the function get_class to the object and find out the name of the class to which the object belongs.

Make two classes: Test1 and Test2. Let both classes have the property name. Create some number of objects of these classes and write them into the array $arr in an arbitrary order. Iterate through this array with a loop and for each object output the value of its property name and the name of the class to which the object belongs.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline