get current class name with get_class

This will return the current class name, can be used in side a function of the current class object or give it another object name to return.

class myclass {
function myfunction() {
echo get_class($this);
}
}

Will echo myclass

Demo

Other Items in php
Page Views

This page has been viewed 64 times.

Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.

❤👩‍💻🕹