This code is already working great in VB and I just want to do this in PHP code. I am using this code to find all the nodes under specific grand (Node) that have no child Nodes