Added solution in PHP and Python