Sunday, April 2, 2017

Matching With Function In PHP


<?php

$string = 'I am Thet Naing Win and who are you?';
$find = '/000/';

function Match($string){
  global $string;
  global $find;
  if(preg_match($find, $string)){
   return true;
  }else{
   return false;
  }
}

if(Match($string)){
  echo 'Match Found!';
}else{
  echo 'Match Not Found!';
}

?>

No comments:

Post a Comment