How to get child categories name programmatically in Magento 2

Add the following code in your phtml file: How to get child categories name programmatically in Magento 2 How to get child categories name programmatically in Magento 2
<?php
error_reporting(E_ALL);
error_reporting(-1);
ini_set('error_reporting', E_ALL);
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');//get current category
    $catId= $category->getId();
    $subCategory = $objectManager->create('Magento\Catalog\Model\Category')->load($catId);
    $subCats = $subCategory->getChildrenCategories();
?>
<ul class="subcat-listing">  
                <?php
    foreach ($subCats as $subcat) {
                $subcatname = $subcat->getName();
                ?>
                
      <li class="subcat-listingg"><a href="<?php echo $subcat->getUrl();
 ?>"><?php echo $subcatname ; ?></a></li>
        <?php } ?>
                 </ul>