A boy has been taken to hospital after being assaulted in a park.