implemented multi layer in php implementation