thank you for all the codes sir... i already have a code and it seems not working...

we have our thesis and that cover home automation sir... you do not need to go home if you thing you forget to turn off your lights... you just simply text your light and it will turned off by itself... our problem sir is to capture the received message coming from the GSM modem and make it as an array. that particular array will be compared to a constant array so that if they are equal, therefore the sent message is correct, and the light will turned off. have i explained it well sir?
and, can we use PDU mode instead of SMS mode sir?