Simplest way how to gets Class without namespace
<?php
namespace a\b\c\d\e\f;
class Foo {
public function __toString() {
$class = explode('\\', __CLASS__);
return end($class);
}
}
echo new Foo(); // prints Foo
?>
Simplest way how to gets Class without namespace
<?php
namespace a\b\c\d\e\f;
class Foo {
public function __toString() {
$class = explode('\\', __CLASS__);
return end($class);
}
}
echo new Foo(); // prints Foo
?>