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