$_POST – check for filling in certain information

For example, I want my script to process data starting with http://google.ru/, and if the user would pass other information, then he would display the text “The link was entered incorrectly.”
How to do this? I was digging last night, I didn’t find anything sensible, except for a check for filling (i.e. if the field is filled, the script works, if not filled, it doesn’t work).

Answer 1, authority 100%


your case is something like this

if (!preg_match("/php/i", "PHP is the web scripting language of choice.")) { //   "php"   "PHP is the web scripting language of choice."
    echo "A match was not found."; //     
} else {
    echo "A match was found.";

Answer 2

Well, this is a standard task for finding a substring in a string. Help on the net is a dime a dozen.