Stackoverflow - Create a php function to add new node