Script for port is open or not

I need a script on which if i will pass the port number and the host name as external parameter then it should respond me if the port is open or not