- str_replace: documentation ( source)
- get_class: documentation ( source)
<?php
namespace Milkway\Earth;
class Human{}
namespace Universe;
$human = new \Milkway\Earth\Human();
echo get_class($human) . PHP_EOL;
$class = str_replace('Earth\\', '', get_class($human));
echo $class;