How to get id of a sub page

Permalink
Im am currently trying to figure out how to use concrete5 but i have a small problem.

The problem is I try to get the page id of a sub page but every time i get de main page id.

This is the code im using
$page = Page::getByID($c->getCollectionParentID()); 
   $id = $page->getCollectionId();
   print_r($id);


So i was wondering how i could the id then

 
eminxd15 replied on at Permalink Reply
UPDATE*

I found a better piece of code
$page = Page::getByID(156);
   $id = $page->getCollectionChildrenArray();
   foreach ($id as $childId) {
   $child = Page::getByID($childId);
   echo $child->getCollectionId().'<br />';


But now the problem is that i can't get a specified id