PHP 正则表达式函数 ereg


PHP 正则表达式函数 ereg

<?php
   $email_id = "admin@codingdict.com";
   $retval = ereg("(\.)(com$)", $email_id);

   if( $retval == true )
   {
      echo "Found a .com<br>";
   }
   else
   {
      echo "Could not found a .com<br>";
   }

   $retval = ereg(("(\.)(com$)"), $email_id, $regs);

   if( $retval == true )
   {
      echo "Found a .com and reg = ". $regs[0];
   }
   else
   {
      echo "Could not found a .com";
   }

?>