Question:

How to write function for getting subcategories of particular category?

Theo: 5 days ago

function productDescription()
{
    $_helper = Mage::helper('catalog/category');
    $category = Mage::getModel('catalog/category')->load($categoryId);
    $_categories = $category->getChildrenCategories() 
    print_r($_categories);
    $array = json_encode($_categories);
    file_put_contents("product_node.json", $array);
}

Answer:
Leilani: 5 days ago

Try like this

$children = Mage::getModel('catalog/category')->getCategories(10);
foreach ($children as $category) {
    echo $category->getName();
}