Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ereg functionsRecommended functions

eregeregi( string $pattern , $sourcestring $string ) : int

Code Block
$source = "My email address is ck@qsok.com";
if (ereg("email", $source)) {
  echo "the source has 'email' on the content";
}


preg_match( string $pattern , $sourcestring $subject ) : int

Code Block
$source = "My email address is ck@qsok.com";
if (preg("/email/", $source)) {
  echo "the source has 'email' on the content";
}


eregi( string $pattern , $sourcestring $string ) : int

Code Block
$source = "My email address is ck@qsok.com";
if (eregi("chun kang", $source)) {
  echo "the source has 'chun kang' on the content";
}


preg_match( string $pattern , $sourcestring $subject ) : int


Code Block
$source = "My email address is ck@qsok.com";
if (preg_match("/Chun Kang/i", $source)) {
  echo "the source has 'email' on the content";
}


eregi( string $pattern , string $string , array &$regs ) : int


Reference URLs