PHP matching string

We can match string in PHP using strrpos function here is the sample code

<?php
function Match($keyword,$subject){
	if(strrpos($subject,$keyword)===false){
		return false;
	}else{
		return true;
	}
}

$keyword = 'insicdesigns.com';
$subject = 'I love insicdesigns.com';

if(Match($keyword,$subject)){
	echo 'Match!';
}else{
	echo 'Not found';
}

?>

It will display…

Match!
PG

Author: admin

Related Post

Delicious